-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kernel: ensure uniform printing of macfloats nan, inf, -inf #2274
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2274 +/- ##
==========================================
- Coverage 71.44% 71.44% -0.01%
==========================================
Files 479 479
Lines 251654 251661 +7
==========================================
+ Hits 179798 179801 +3
- Misses 71856 71860 +4
|
OK, this does give Is there a way to test |
You mean a way to generate a NaN, like |
Right, this works (with the branch here) on SPARC Solaris
Would you mind adding tests for this in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Should we document this, since it might just surprise someone who system usually prints NoN
?
@stevelinton so far, we only know of one system which does not print So, I'd rather not spend time on documenting this. Of course on the long run, it would be nice to document how nan and inf etc. are printed in general, but that's part of the bugger "floating points in GAP need to be better documented" issue and so IMHO beyond the scope of this PR... |
It's bigger than 1, e.g. @jdemeyer can also be considered counted in :-) but not that we know more. I'd reiterate that printing |
e3bd632
to
780f81f
Compare
I added some tests and also made |
Also add some tests
On some platforms, NaN values might be printed as `nan`, on others as `NaN`; on some, the sign of the Nan value may be printed, on other not so (and the sign of a NaN is something which highly depends on the float implementation to start with). This made it difficult to write tests which rely on the way these values are printed. Hence we now deal with these values explicitly and in a manner which produces identical results across all platforms. Fixes gap-system#2193
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, thanks!
I agree. At least it checks that GAP doesn't crash when encountering a |
On some platforms, NaN values might be printed as
nan
, on others asNaN
;on some, the sign of the Nan value may be printed, on other not so (and the
sign of a NaN is something which highly depends on the float implementation to
start with).
This made it difficult to write tests which rely on the way these values are
printed. Hence we now deal with these values explicitly and in a manner which
produces identical results across all platforms.
Fixes #2193