As you use more bits to store integer numbers (lots of cpus are using 64 bits these days), you get to do arithmetic over a larger range, and it will always be exact in the integer domain (where fractional values do not exist). As you use more bits to store floating-point numbers (cpus have been supporting 64-bit floats for a long time now), you get to do arithmetic over a much larger range with greater accuracy.
These considerations used to demand more attention from programmers, back when it was a lot harder, slower and/or more expensive to use more bits for numbers. These days, it still matters to some people who handle values or differences of extremely large or extremely small magnitude, but for most folks, it's just not an issue any more. With all arithmetic being done in 64-bit floating point, you don't start losing exactness in the integer domain until you get up around 2**50. And although speed of computation can be an issue, usually it is not (and in the rare cases where it is a killer issue, you shouldn't be doing the arithmetic in Perl anyway -- use C instead).
Bottom line: don't worry about it. If you want things like "13/5" to produce an integer result, just do "int( 13/5 )".
20040928 Edit by Corion: Changed title from 'Re: Don't understand, what this means'
In reply to Re: Confusion Regarding Perl's Numerical Handling
by graff
in thread Confusion Regarding Perl's Numerical Handling
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |