Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Hi,
With perl 5.10 (and no doubt earlier) on linux, the string 'nan', when used in a numeric context, actually becomes a nan ... and the string 'inf', when used in a numeric context, actually becomes an infinity.

I understand it has something to do with the underlying libc, but I'm also wondering what the underlying rationale is (if there *is* any). Is there, eg, some IEEE standard that encourages this nauseating behaviour ?

Afaict on Win32, there's no string (PV) that, when used in numeric context, will be treated as either a nan or an infinity ... and, to my way of thinking, that's exactly as it should be. For once windows gets it right and ignores the "Ooooh, wouldn't it be groovy to have strings that become nans/infinities when used numerically" temptation.

But, then again, I've been wrong before and maybe there are good reasons that perl on linux decides to indulge in what are, to me, nothing more than gimmicks for the feeble-minded. That being the case, precisely what *are* those "good reasons" ?

Cheers,
Rob

In reply to nans, infs, and vomit by syphilis

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others scrutinizing the Monastery: (2)
    As of 2021-02-27 16:23 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?