in reply to Floating Point Errors
Likewise, two floating point numbers should be considered equal if their difference is zero (as defined by your application). This is something that you always have to do when you use floating point numbers.sub is_zero { abs($_[0]) < 1e-10 }
For more on the subject, see the node Why is Zero not 0?
If you need exact arithmetic, perl has support for arbitrary precision numbers in the form of big integers and big rationals. See perldoc bigint and perldoc bigrat respectively.
|
|---|