|Anonymous | Login | Signup for a new account||2014-11-01 13:36 CET|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0004948||OCaml||OCaml documentation||public||2009-12-23 03:33||2012-04-10 17:58|
|Target Version||Fixed in Version|
|Summary||0004948: There are many NaNs|
|Description||The documentation makes it sound like there exists a single NaN value. |
The following improvements could be done :
1) In the documentation of compare, note that compare equates all NaN value.
2) In the paragraph preceding floating point functions, indicate that
0. /. 0. returns a NaN value (instead of Pervasives.nan) and that
any function taking a NaN (instead of Pervasives.nan) value returns a
NaN value (instead of Pervasives.nan).
3) In the documentation of Pervasives.nan, indicate that nan is a NaN value
but that may not be the one you get in 0. /. 0.
|Tags||No tags attached.|
Yes, IEEE 754 allows for multiple NaN values, and I've never seen a program take advantage of that. But the point is that all these NaNs are not distinguishable from Caml: as you noticed, they compare equal according to Pervasives.compare. So, I don't see the need to complicate the documentation to talk about something that is invisible to the programmer.
Maybe you are right, it's not worth it for the casual user.
In fact I was just surprised by this :
# compare nan (0. /. 0.);;
- : int = 0
# compare (Int64.bits_of_float nan) (Int64.bits_of_float (0. /. 0.));;
- : int = 1
I think we agree we don't want to trouble normal users with the minute details of NaN specifications.
I'm closing this PR.
|2009-12-23 03:33||dbuenzli||New Issue|
|2009-12-30 16:00||xleroy||Note Added: 0005212|
|2009-12-30 16:00||xleroy||Status||new => feedback|
|2009-12-30 17:42||dbuenzli||Note Added: 0005215|
|2010-04-29 19:28||xleroy||Relationship added||related to 0005038|
|2012-04-10 17:58||doligez||Note Added: 0007314|
|2012-04-10 17:58||doligez||Status||feedback => resolved|
|2012-04-10 17:58||doligez||Resolution||open => won't fix|
|Copyright © 2000 - 2011 MantisBT Group|