Skip to content
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

NaN, min & max #4151

Closed
vicuna opened this Issue Nov 7, 2006 · 1 comment

Comments

Projects
None yet
1 participant
@vicuna
Copy link
Collaborator

vicuna commented Nov 7, 2006

Original bug ID: 4151
Reporter: Colas
Status: closed (set by @xavierleroy on 2009-08-28T09:06:53Z)
Resolution: fixed
Priority: normal
Severity: minor
Fixed in version: 3.11.2+dev
Category: documentation
Monitored by: @dbuenzli

Bug description

min and max behaviour on the uncomparable float NaN is not documented.

From the documentation on compare, "max 0. nan" may:

  • raise an error: "the comparison predicates treat nan as different from any other float value, including itself"
  • return 0.: "compare treats nan as equal to itself and less than any other float value"

or return nan: "any operation with nan as argument returns nan as result"
(introduction of Floating-point arithmetic section)

It does none of the above, and change between 3.08.3 and 3.09.2 without being in the changelog:
Objective Caml version 3.08.3

max 0. nan;;

  • : float = nan

max nan 0.;;

  • : float = 0.

min 0. nan;;

  • : float = nan

min nan 0.;;

  • : float = 0.

    Objective Caml version 3.09.2

max 0. nan;;

  • : float = nan

max nan 0.;;

  • : float = 0.

min 0. nan;;

  • : float = 0.

min nan 0.;;

  • : float = nan

--
Colas

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Aug 28, 2009

Comment author: @xavierleroy

Clarified documentation in 3.11 release branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.