Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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
Domain Nodelet?
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 about the Monastery: (6)
As of 2022-07-05 21:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?