Skip to content

Commit 5415b12

Browse files
mrzasamrkn
authored andcommitted
Improve documentation of BigDecimal#sign
Fixes #78 by describing behaviour for positive and negative zero in the docs.
1 parent be366c9 commit 5415b12

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ext/bigdecimal/bigdecimal.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3606,8 +3606,10 @@ BigDecimal_limit(int argc, VALUE *argv, VALUE self)
36063606

36073607
/* Returns the sign of the value.
36083608
*
3609-
* Returns a positive value if > 0, a negative value if < 0, and a
3610-
* zero if == 0.
3609+
* Returns a positive value if > 0, a negative value if < 0.
3610+
* It behaves the same with zeros -
3611+
* it returns a positive value for a positive zero (BigDecimal('0')) and
3612+
* a negative value for a negative zero (BigDecimal('-0')).
36113613
*
36123614
* The specific value returned indicates the type and sign of the BigDecimal,
36133615
* as follows:

0 commit comments

Comments
 (0)