Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^4: Surviving 'Illegal division by zero'

by ViceRaid (Chaplain)
on Jun 23, 2004 at 22:17 UTC ( [id://369192]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    class Float
      alias :old_divide :/ 
    ...
        other == 0 ? nil : old_divide(other)
      end
    end
    
  2. or download this
    class MyFloat < Float
      def MyFloat.new(from)
    ...
      end
    end
    MyFloat.new(4) / 0 # nil
    
  3. or download this
    use warnings;
    
    ...
        no warnings qw/uninitialized/;
        $foo = 5 - $qux;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 16:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found