asp.net mvc 4 - C# Using Bool, how to check a double is truly divisible by another number? -
this question has answer here:
is there way of checking value wholly divisible number, example 1000 divided 100 true, 1115 divided 100 false?
i tring
any appreciated :-)
you can use %-operator:
bool isdivisible = 1115 % 100 == 0; the % operator computes remainder after dividing first operand second. numeric types have predefined remainder operators.
Comments
Post a Comment