Closed GlitchlessCode closed 6 months ago
I made sure to test this as extensively as possible, and I couldn't find any edge cases where it broke (apart from y=0
, which now correctly returns a fail). This includes int/int, int/float, float/int, float/float, positive/positive, positive/negative, negative/positive, negative/negative, extremely small values (including exponenent notation), extremely large values, and very long decimals.
excellent work as always ty
Oh woops, thanks for catching that :P I had that for debugging purposes
The Suggestion
Comes from #11
Implementation description
fmod
algorithmx % y = x - truncate(x / y) * y
floor
which always rounds down,truncate
rounds towards 0x
andy
y=0
by failinggm:modulo
to list of functions