[ruby/bigdecimal] Improve documentation of BigDecimal#sign
Fixes https://github.com/ruby/bigdecimal/issues/78 by describing behaviour for positive and negative zero in the docs. https://github.com/ruby/bigdecimal/commit/5415b120ab
This commit is contained in:
parent
81b919ce5c
commit
8e2c425183
@ -3606,8 +3606,10 @@ BigDecimal_limit(int argc, VALUE *argv, VALUE self)
|
|||||||
|
|
||||||
/* Returns the sign of the value.
|
/* Returns the sign of the value.
|
||||||
*
|
*
|
||||||
* Returns a positive value if > 0, a negative value if < 0, and a
|
* Returns a positive value if > 0, a negative value if < 0.
|
||||||
* zero 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,
|
* The specific value returned indicates the type and sign of the BigDecimal,
|
||||||
* as follows:
|
* as follows:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user