summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-07 00:02:21 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-07 00:02:45 +0900
commite89d9f3debab353d1c5a5162752af8f201d98d49 (patch)
tree4e3047d55ec5a7b28d406e97ff67f4a98c5d0312 /numeric.c
parent0ed298f382e0fc0f119f4896394aacf3b74f6687 (diff)
Deprecate Float::ROUNDS, which should not be a constant
[Bug #16044]
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/numeric.c b/numeric.c
index 2f5da6f887..d56b2d6559 100644
--- a/numeric.c
+++ b/numeric.c
@@ -5687,7 +5687,9 @@ Init_Numeric(void)
rb_undef_method(CLASS_OF(rb_cFloat), "new");
/*
- * Represents the rounding mode for floating point addition.
+ * Deprecated, do not use.
+ *
+ * Represents the rounding mode for floating point addition at the start time.
*
* Usually defaults to 1, rounding to the nearest number.
*
@@ -5700,6 +5702,7 @@ Init_Numeric(void)
* 3:: Rounding towards negative infinity
*/
rb_define_const(rb_cFloat, "ROUNDS", INT2FIX(FLT_ROUNDS));
+ rb_deprecate_constant(rb_cFloat, "ROUNDS");
/*
* The base of the floating point, or number of unique digits used to
* represent the number.