From TinyMUX
Jump to navigation Jump to search


FUNCTION: 20px-Function.png fmod(number1, number2)

Returns the smallest positive floating-point remainder left from dividing number1 by number2.

Related Topics: mod()


> say round(fmod(6.1,2.5),3)
You say "1.100"
> say fmod(0,0)
You say "Ind"

Server Differences

In the above example, TinyMUX's fmod() does not return '1.1' exactly but '1.0999999999999996'. PennMUSH, RhostMUSH, and TinyMUSH automatically round to a pre-defined decimal place (usually the sixth decimal place).

TinyMUX also treats +Inf, -Inf, Ind, and NaN as special named numbers. PennMUSH typically treats +Inf, -Inf, and NaN similarly.