Does anyone have an idea how is the method/function Int()
or floor()
implemented?
What I am looking for a respective implementation as the following is for abs()
function.
Int Abs (float x){
if x > 0
return x;
else
return -x
}
I am struggling to find a solution for it without using the modulus operator.
Seems to me like
floor(n) = n - (n % 1)
should do the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With