Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 about the Monastery: (7)
As of 2015-07-05 14:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (67 votes), past polls