Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Not a Number

by George_Sherston (Vicar)
on Oct 18, 2002 at 10:48 UTC ( #206259=note: print w/replies, xml ) Need Help??


in reply to Not a Number

This question seems to come round with the fall of the leaf. When I asked it last year I didn't realise that it was so interesting and complex. Now I know, though I admit part of me just wants to say, like Sir Roger de Coverley would if he'd had a Babbage Engine, "well come on, I mean to say dash it all, a thing's either a number or it's not, don't you know?"

George Sherston

Replies are listed 'Best First'.
Re: Re: Not a Number
by broquaint (Abbot) on Oct 18, 2002 at 11:17 UTC
    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

      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://206259]
help
Chatterbox?
[Corion]: holli: Ooof :)
[hippo]: Cut should beless than 20% after tax, though. :-)
[Corion]: hippo: Yeah, but at least two years ago, it still was close enough to 20% cut
[Corion]: But I have a very positive experience with a four day workweek and a three day weekend. I can't easily go back though to full money.
[Corion]: That is easy without having to pay for a house, a wife or children though. If I had any of these, or any two of these, the decision wouldn't be that easy.
[ambrus]: wait. I understand no wife and children, but how do you not have to pay for a house?

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2017-09-21 15:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (249 votes). Check out past polls.

    Notices?