Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Possible errors in MOD function?

Status
Not open for further replies.

kristof

Programmer
Jun 2, 2000
234
BE
Hi,

Is it in any way possible that the mod function returns a wrong result?

eg:

<cfset nmb = 130.92>
<cfset md = nmb * 100 mod 97>

The result was that md contained the value 93 while it should have been 94

Anyone know how or why this is possible?

Thanx
 
If you do
13092 MOD 97
the the result is 94
or
<cfset nmb = 13092>
nmb MOD 97
the result is also 94
so obviously the MOD function only like round number and not floating numbers.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top