@@ -21,8 +21,8 @@ perfectly the same as `2000`.
2121
2222Another way to create an Integer is by calling ` Integer() ` with a parameter, e.g.:
2323
24- ` Integer(3) ` # => 3
25- ` Integer('3') ` # => 3
24+ ` Integer(3) ` * # => 3*
25+ ` Integer('3') ` * # => 3*
2626
2727Internally, Ruby uses two different classes for Integers. Dependent on how big the
2828Integer is it uses a * Fixnum* or a * Bignum* . You don't have to worry about which class to
@@ -32,8 +32,8 @@ However, you can check which class Ruby uses for your number by calling the `cla
3232method on your number. Open a new terminal tab and open the interactive Ruby console
3333with ` irb ` . Then check the class of different numbers:
3434
35- ` 1000.class ` # => * Fixnum*
36- ` 4_611_686_018_427_387_904.class ` # => * Bignum*
35+ ` 1000.class ` * # => Fixnum*
36+ ` 4_611_686_018_427_387_904.class ` * # => Bignum*
3737
3838If you want to learn more, read about Fixnum and Bignum here:
3939- http://patshaughnessy.net/2014/1/9/how-big-is-a-bignum
@@ -46,8 +46,8 @@ You can create a Float by declaring a number with a decimal place, like `3.0`
4646or ` -2_000.25 ` .
4747Another way to create a Float is to call ` Float() ` with a parameter, e.g.:
4848
49- ` Float(3) ` # => 3.0
50- ` Float('3') ` # => 3.0
49+ ` Float(3) ` * # => 3.0*
50+ ` Float('3') ` * # => 3.0*
5151
5252Read more about Float here: (ruby-doc core: Float).
5353
@@ -56,9 +56,9 @@ Read more about Float here: (ruby-doc core: Float).
5656A * Rational* represents a rational number (a paired integer number a/b, where b > 0).
5757You can create a Rational by calling ` Rational() ` with one or two parameters, e.g.:
5858
59- ` Rational(2) ` # => * (2/1)*
60- ` Rational(2, 3) ` # => * (2/3)*
61- ` Rarional('2/3') ` # => * (2/3)*
59+ ` Rational(2) ` * # => (2/1)*
60+ ` Rational(2, 3) ` * # => (2/3)*
61+ ` Rarional('2/3') ` * # => (2/3)*
6262
6363Read more about Rational here: (ruby-doc core: Rational).
6464
@@ -67,10 +67,10 @@ Read more about Rational here: (ruby-doc core: Rational).
6767A * Complex* represents a complex number.
6868You can create a complex number by calling ` Complex() ` with one or two parameters, e.g.:
6969
70- ` Complex(2) ` # => * (2+0i)*
71- ` Complex(2.1, 0.2) ` # => * (2.1+0.2i)*
72- ` Complex('2.1+0.2i') ` # => * (2.1+0.2i)*
73- ` Complex('2.1@0.2') ` # => * (2.0581398134666076+0.4172055946696286i)* - polar form
70+ ` Complex(2) ` * # => (2+0i)*
71+ ` Complex(2.1, 0.2) ` * # => (2.1+0.2i)*
72+ ` Complex('2.1+0.2i') ` * # => (2.1+0.2i)*
73+ ` Complex('2.1@0.2') ` * # => (2.0581398134666076+0.4172055946696286i)* - polar form
7474
7575Read more about Complex here: (ruby-doc core: Complex).
7676
0 commit comments