Modulus math
No edit summary
(Updated Edited template to July 12, 2025.)
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
In c# you do 5%3 to get the rest of the division 5/3
<message>Write the content here to display this box</message>
In C#, do 5%3 to get the rest of the division 5/3. In OCL, you can do 5.IEEERemainder( 3 )


In ocl you can do 5.IEEERemainder( 3 )
(Please note that modulus and remainder are not mathematically equivalent.  


(please take note that modulus and remainder is not mathematically equivalent, however the "%" operator in c# is the IEEERemainder. See https://rob.conery.io/2018/08/21/mod-and-remainder-are-not-the-same/ )
See also: https://rob.conery.io/2018/08/21/mod-and-remainder-are-not-the-same/)


See [https://docs.microsoft.com/en-us/dotnet/api/system.math.ieeeremainder IEEERemainder documentation in .net]
See also: [https://docs.microsoft.com/en-us/dotnet/api/system.math.ieeeremainder IEEERemainder documentation in .net]
[[Category:OCL]]
[[Category:C-Sharp]]
{{Edited|July|12|2025}}

Latest revision as of 05:53, 20 January 2025

This page was created by Hans.karlsen@mdriven.net on 2021-12-04. Last edited by Edgar on 2025-01-20.

In C#, do 5%3 to get the rest of the division 5/3. In OCL, you can do 5.IEEERemainder( 3 )

(Please note that modulus and remainder are not mathematically equivalent.

See also: https://rob.conery.io/2018/08/21/mod-and-remainder-are-not-the-same/)

See also: IEEERemainder documentation in .net