Skip to content

Commit

Permalink
Improve documentation of BigDecimal#sign
Browse files Browse the repository at this point in the history
Fixes #78 by describing behaviour for positive and negative zero in the docs.
  • Loading branch information
mrzasa authored and mrkn committed Sep 25, 2022
1 parent be366c9 commit 5415b12
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ext/bigdecimal/bigdecimal.c
Original file line number Diff line number Diff line change
Expand Up @@ -3606,8 +3606,10 @@ BigDecimal_limit(int argc, VALUE *argv, VALUE self)

/* Returns the sign of the value.
*
* Returns a positive value if > 0, a negative value if < 0, and a
* zero if == 0.
* Returns a positive value if > 0, a negative value if < 0.
* It behaves the same with zeros -
* it returns a positive value for a positive zero (BigDecimal('0')) and
* a negative value for a negative zero (BigDecimal('-0')).
*
* The specific value returned indicates the type and sign of the BigDecimal,
* as follows:
Expand Down

0 comments on commit 5415b12

Please sign in to comment.