Fmod()

From TinyMUX
Revision as of 05:03, 17 January 2006 by Ian (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.