On 3/20/07, Rob Dixon <[EMAIL PROTECTED]> wrote:
snip
You seem very indignant that Perl is offering you a floating-point result -
it started giving 24.5 right at the beginning of its life! What are these
languages you have used that give only an integer result for division? I
can think of none off the top of my head. What do they return if you ask
for 4/12*9?
snip

In many (if not most) statically typed languages, math with integer
types produces integer types.  A few examples are ANSI C, C++, Pascal,
and Java.  In those languages if you say 4/12*9 you get back 0.  If
you want  2.99999 then you need to be certain that you are doing
floating point math, not integer math: 4.0/12*9.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to