Fmod()

From TinyMUX
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Description

FUNCTION: fmod(number1, number2)

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

Related Topics: mod()

Examples

> 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.