what are you complaining about?Nothing, no complaints at all ... mainly just trying to fathom whether the Math::MPFR object returned by "Math::MPFR->new()" (whose
value is NaN) should be true or false.
The object returned by "Math::MPFR->new(0)" is false because its
value is 0, and it seems anomalous to me that "Math::MPFR->new()" should be deemed true even though it has been assigned
no value at all.
I could rewrite the module so that "Math::MPFR->new()" returns an object whose
value is zero (or some other randomly chosen number), but that would be deviating from the way the mpfr C library behaves.
Sorry - must've misunderstood your point. (I'm pretty thick.)
A post to the mpfr mailing list returned the info that when both ECMAScript and XPath convert a number to the boolean type, "the result is false if
the argument is +0, -0, or NaN; otherwise the result is true."
Hardly compelling stuff, but at least it makes me feel a bit less like a fucking freak.
Anyway, I'll just leave Math::MPFR as is for now - ie Math::MPFR objects whose
values are 0, -0 or NaN are false, all other Math::MPFR objects are true . No-one has yet complained about it, and I don't anticipate that anyone ever will.
Many thanks to all respondents (including
you) ... many interesting approaches and views.
Cheers,
Rob
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, details, 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, summary, 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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.