Skip to content

Commit

Permalink
doc: some wording adjustments for isequal.
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski committed May 2, 2014
1 parent b5e0b73 commit 9a48950
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions doc/stdlib/base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,19 @@ All Objects

.. function:: isequal(x, y)

Similar to ``==``, except treats all floating-point ``NaN`` values as equal, and
treats ``-0.0`` as unequal to ``0.0``. Falls back to ``==``.
Similar to ``==``, except treats all floating-point ``NaN`` values as equal to each other
and greater than all other real values, and treats ``-0.0`` as unequal to ``0.0``.

This comment has been minimized.

Copy link
@JeffBezanson

JeffBezanson May 3, 2014

Member

How can isequal treat one value as greater than another? Maybe you meant to put that in the help for isless?

This comment has been minimized.

Copy link
@StefanKarpinski

StefanKarpinski May 3, 2014

Author Member

Yeah, I realized that after pushing this.

For values that are not floating-point, ``isequal`` is the same as ``==``.

``isequal`` is the comparison function used by hash tables (``Dict``).
``isequal(x,y)`` must imply ``hash(x)==hash(y)``.
``isequal(x,y)`` must imply that ``hash(x) == hash(y)``.

Mutable containers should generally implement ``isequal`` by calling ``isequal``
recursively on all contents.
Mutable containers typically implement ``isequal`` by calling ``isequal`` recursively on
all contents.

Other new types generally do not need to implement this function, unless they
Scalar types generally do not need to implement ``isequal``, unless they
represent floating-point numbers amenable to a more efficient implementation
than that provided by a generic fallback (based on ``isnan``, ``signbit``, and ``==``).
than that provided as a generic fallback (based on ``isnan``, ``signbit``, and ``==``).

.. function:: isless(x, y)

Expand Down

0 comments on commit 9a48950

Please sign in to comment.