Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^4: Surviving 'Illegal division by zero'

by ViceRaid (Chaplain)
on Jun 23, 2004 at 22:17 UTC ( #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
Node Status?
node history
Node Type: note [id://369192]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2014-12-27 08:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls