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

Re: Re: Not a Number

by broquaint (Abbot)
on Oct 18, 2002 at 11:17 UTC ( #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
Node Status?
node history
Node Type: note [id://206273]
help
Chatterbox?
and the web crawler heard nothing...

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












    Results (249 votes). Check out past polls.

    Notices?