Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Re: Not a Number

by broquaint (Abbot)
on Oct 18, 2002 at 11:17 UTC ( [id://206273]=note: print w/replies, xml ) Need Help??


in reply to Re: Not a Number
in thread Not a Number

It may be a little late now but here's a funky little subroutine from merlyn that distinguishes between numbers and strings
sub is_numeric { ($_[0] & ~ $_[0]) eq "0"; }
The original post can be found here.
HTH

_________
broquaint

Replies are listed 'Best First'.
Re: Re: Re: Not a Number
by rasta (Hermit) on Oct 18, 2002 at 15:24 UTC
    OK, what will your subroutine return for '1e+2'?..
    perltod() works fine.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-25 17:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found