The mod() function returns the integer remainder of a division


The mod() function returns the integer remainder of a division

Author
Message
Blackadder
Blackadder
Guru
Guru (16K reputation)Guru (16K reputation)Guru (16K reputation)Guru (16K reputation)Guru (16K reputation)Guru (16K reputation)Guru (16K reputation)Guru (16K reputation)Guru (16K reputation)

Group: Forum Members
Posts: 280, Visits: 147

Just a quick note: other than stated in the help, Inquisit's mod() function computes the integer remainder of a division.

Examples

mod(1,2)  = 1
mod(2,9)  = 2
mod(11,4) = 3


I haven't tested what mod(3.14,2) would yield but I assume it to be 1.14.

Bye, Malte


Dave
Dave
Supreme Being
Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)

Group: Administrators
Posts: 9.8K, Visits: 46K

Inquisit's mod() function computes the integer remainder of a division


... as any well-behaved mod function should do. But indeed, you are correct in that the documentation is wrong.


~Dave


Blackadder
Blackadder
Guru
Guru (16K reputation)Guru (16K reputation)Guru (16K reputation)Guru (16K reputation)Guru (16K reputation)Guru (16K reputation)Guru (16K reputation)Guru (16K reputation)Guru (16K reputation)

Group: Forum Members
Posts: 280, Visits: 147

Oh, and by the way, this is not at all a complaint, I applaude this discrepancy to the manual. The fraction part of a division can easily be computed by


  fpart(a/b)


while mirroring the "normal" mod() behavior with a mod function as described in the manual is a tad more irky.


Bye, Malte.


GO


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....






Millisecond Forums


Search