Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Math::Round::Var::round() takes no action when a number is not supplied

by toolic (Bishop)
on Aug 30, 2011 at 17:04 UTC ( #923267=note: print w/replies, xml ) Need Help??


in reply to Math::Round::Var::round() takes no action when a number is not supplied

Did you try it? I get a warning:
use Math::Round::Var; my $rnd = Math::Round::Var->new(0.01); # rounds to two decimal places: print $rnd->round(), "\n"; __END__ Use of uninitialized value in sprintf at .../Math/Round/Var.pm line 22 +9. 0.00
The module's source code uses warnings.
  • Comment on Re: Math::Round::Var::round() takes no action when a number is not supplied
  • Download Code

Replies are listed 'Best First'.
Re^2: Math::Round::Var::round() takes no action when a number is not supplied
by metaperl (Curate) on Aug 31, 2011 at 02:18 UTC
    Did you try it?
    I shore did.
    I get a warning
    That warning came from Perl - the subroutine simply assumed you wanted to round the number zero - an undefined value was coerced to zero in context.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2020-10-31 16:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (290 votes). Check out past polls.

    Notices?