Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^2: unintentional conversion of signaling NaN to quiet NaNby BrowserUk (Patriarch) |
on Jun 24, 2016 at 09:19 UTC ( [id://1166474]=note: print w/replies, xml ) | Need Help?? |
I think a perlbug report should be filed for this. Thing is, there is not a lot that Perl can do about it, as it is the default (and preferred) behaviour for floating point. In the code below, the bit pattern 0x0x7ff0000000000001 displays as SNaN, only when nothing has caused the value to be loaded into a floating point register. As soon as the value is loaded into an FP register, it gets silently converted to a QNan; and if the operation causes the result to be stored back to memory, the bit pattern will have been changed to a QNaN pattern. And, I've tried every combination of Exception Mask bits in the FP control word to change that behaviour and nothing does. I do not see how Perl could change that behaviour outside of emulating FP in software? Note how both the displayed representation of the value and the bit pattern change as soon as *any* floating point operation is performed on the value:
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice. Not understood.
In Section
Seekers of Perl Wisdom
|
|