Deprecate Float::ROUNDS, which should not be a constant

[Bug #16044]
This commit is contained in:
Nobuyoshi Nakada 2019-08-07 00:02:21 +09:00
parent 0ed298f382
commit e89d9f3deb
No known key found for this signature in database
GPG Key ID: 4BC7D6DF58D8DF60

View File

@ -5687,7 +5687,9 @@ Init_Numeric(void)
rb_undef_method(CLASS_OF(rb_cFloat), "new"); 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. * Usually defaults to 1, rounding to the nearest number.
* *
@ -5700,6 +5702,7 @@ Init_Numeric(void)
* 3:: Rounding towards negative infinity * 3:: Rounding towards negative infinity
*/ */
rb_define_const(rb_cFloat, "ROUNDS", INT2FIX(FLT_ROUNDS)); 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 * The base of the floating point, or number of unique digits used to
* represent the number. * represent the number.