Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Surviving 'Illegal division by zero'

by andyf (Pilgrim)
on Jun 23, 2004 at 16:57 UTC ( [id://369116]=note: print w/replies, xml ) Need Help??


in reply to Surviving 'Illegal division by zero'

The best value for Wufniks $ff (the fuzz factor or often epsilon) is given in POSIX. From Mastering Algorithms with Perl (the wolf book pp.472 - 474)

If you have the POSIX module you may use the DBL_EPSILON constant that it defines:
use POSIX; use constant epsilon => 100 * DBL_EPSILON;
Very useful in dsp to write machine independent code. You dont't want to find it all breaks when you port it somewhere else. Although its messier in just one place Abigails choice of overloading the operator is probably the most elegant general solution imo.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://369116]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-03-29 09:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found