[M3devel] in favor of mixed operators..

Mika Nystrom mika at async.async.caltech.edu
Mon Jan 18 02:58:33 CET 2010


Jay I think the following paragraph is important and demonstrates why
this article is perhaps less relevant to Modula-3:

When you write a function implementing a numeric algorithm (for example,
calculating the phase of the moon) you typically expect the arguments
to be specified as floating point numbers. However, since Python doesnt
have type declarations, nothing is there to stop a caller from providing
you with integer arguments. In a statically typed language, like C,
the compiler will coerce the arguments to floats, but Python does no
such thing  the algorithm is run with integer values until the wonders
of mixed-mode arithmetic produce intermediate results that are floats.

     Mika

Jay K writes:
>--_671e4a34-689a-4d86-98d3-1f8935f7844b_
>Content-Type: text/plain; charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
>
>http://python-history.blogspot.com/2009/03/problem-with-integer-division.ht=
>ml
>
>
>He argues that for a "high level" language=2C of course
>I should be able to add int to long=2C int to float=2C etc.
>And that int / int should not be int.
>At least Modula-3 spells them differently=2C / vs. MOD.
>
>
>Of course=2C "high level" vs. "systems" vs. "one size to fit all"...
>
>
>Anyway=2C I give up here.
>
>
> - Jay
>
>
>
>
> 		 	   		  =
>
>--_671e4a34-689a-4d86-98d3-1f8935f7844b_
>Content-Type: text/html; charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
><html>
><head>
><style><!--
>.hmmessage P
>{
>margin:0px=3B
>padding:0px
>}
>body.hmmessage
>{
>font-size: 10pt=3B
>font-family:Verdana
>}
>--></style>
></head>
><body class=3D'hmmessage'>
>http://python-history.blogspot.com/2009/03/problem-with-integer-division.ht=
>ml<br><br><br>He argues that for a "high level" language=2C of course<br>I =
>should be able to add int to long=2C int to float=2C etc.<br>And that int /=
> int should not be int.<br>At least Modula-3 spells them differently=2C / v=
>s. MOD.<br><br><br>Of course=2C "high level" vs. "systems" vs. "one size to=
> fit all"...<br><br><br>Anyway=2C I give up here.<br><br><br>&nbsp=3B- Jay<=
>br><br><br><br><br> 		 	   		  </body>
></html>=
>
>--_671e4a34-689a-4d86-98d3-1f8935f7844b_--



More information about the M3devel mailing list