[M3devel] integer division rounding?

Jay K jay.krell at cornell.edu
Sun Jan 17 10:36:55 CET 2010


Modula-3 apparently specifies integer division as rounding down.
http://www.modula3.com/cm3/doc/reference/arithmetic.html

C used to leave it unspecified. So it could be fast.
Fortran rounded to zero.
C's ldiv function rounds to zero.
C now rounds to zero with C99.
  The rationale was that nobody using Fortran seemed to mind.
Java apparently rounds toward zero.
C# apparently rounds toward zero.


I'm assuming we are stuck being different here?

 - Jay

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20100117/f4cdb077/attachment-0001.html>


More information about the M3devel mailing list