How do I determine if a digit divided by 8 is an integer?
for example:
32 % 8 = 4, it is an integer.
25 % 8 = 3.125, it is not an integer.
I need a working code like:
if ($str % 8 == integer){
// continue working
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
the
%operator, modulo, will ALWAYS return an integer – it’s the remainder of the division.If you mean you want to check if a number is evenly divisible by 8, then do