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. --- doc/syntax/literals.rdoc | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'doc/syntax') diff --git a/doc/syntax/literals.rdoc b/doc/syntax/literals.rdoc index cfdbb71700..b663f27816 100644 --- a/doc/syntax/literals.rdoc +++ b/doc/syntax/literals.rdoc @@ -22,6 +22,8 @@ true value in conditional expressions. == Numbers +=== \Integer Literals + You can write integers of any size as follows: 1234 @@ -31,15 +33,6 @@ These numbers have the same value, 1,234. The underscore may be used to enhance readability for humans. You may place an underscore anywhere in the number. -Floating point numbers may be written as follows: - - 12.34 - 1234e-2 - 1.234E1 - -These numbers have the same value, 12.34. You may use underscores in floating -point numbers as well. - You can use a special prefix to write numbers in decimal, hexadecimal, octal or binary formats. For decimal numbers use a prefix of 0d, for hexadecimal numbers use a prefix of 0x, for octal numbers use a @@ -68,7 +61,18 @@ Examples: All these numbers have the same decimal value, 170. Like integers and floats you may use an underscore for readability. -=== Rational numbers +=== Floating-Point Literals + +Floating-point numbers may be written as follows: + + 12.34 + 1234e-2 + 1.234E1 + +These numbers have the same value, 12.34. You may use underscores in floating +point numbers as well. + +=== Rational Numbers Numbers suffixed by +r+ are Rational numbers. -- cgit v1.2.1