From eac7c635387622f3b3fd58f98a7943b70ea14e32 Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Sat, 27 Nov 2021 13:07:37 -0600 Subject: Enhanced RDoc for numeric.c (#5184) Adds remarks about literals and Kernel methods to Float and Integer. --- numeric.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index c15131cc1c..4492af5bb3 100644 --- a/numeric.c +++ b/numeric.c @@ -934,9 +934,9 @@ num_negative_p(VALUE num) /******************************************************************** * - * Document-class: Float + * Document-class: Float * - * Float objects represent inexact real numbers using the native + * A \Float object represents a sometimes-inexact real number using the native * architecture's double-precision floating point representation. * * Floating point has a different arithmetic and is an inexact number. @@ -946,6 +946,11 @@ num_negative_p(VALUE num) * - https://github.com/rdp/ruby_tutorials_core/wiki/Ruby-Talk-FAQ#floats_imprecise * - https://en.wikipedia.org/wiki/Floating_point#Accuracy_problems * + * You can create a \Float object explicitly with: + * + * - Global method {Float}[Kernel.html#method-i-Float]. + * - A {floating-point literal}[doc/syntax/literals_rdoc.html#label-Floating-Point+Literals]. + * * == What's Here * * First, what's elsewhere. \Class \Float: @@ -3472,6 +3477,11 @@ rb_num2ull(VALUE val) * * An \Integer object represents an integer value. * + * You can create an \Integer object explicitly with: + * + * - Global method {Integer}[Kernel.html#method-i-Integer]. + * - An {integer literal}[doc/syntax/literals_rdoc.html#label-Integer+Literals]. + * * An attempt to add a singleton method to an instance of this class * causes an exception to be raised. * -- cgit v1.2.1