Skip to content

Commit 3c0e8bb

Browse files
committed
Use emphasized style of return values consistently
1 parent 11313be commit 3c0e8bb

3 files changed

Lines changed: 27 additions & 25 deletions

File tree

2_Numbers/1_The_different_types_of_numbers/task.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ perfectly the same as `2000`.
2121

2222
Another 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

2727
Internally, Ruby uses two different classes for Integers. Dependent on how big the
2828
Integer 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
3232
method on your number. Open a new terminal tab and open the interactive Ruby console
3333
with `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

3838
If 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`
4646
or `-2_000.25`.
4747
Another 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

5252
Read more about Float here: (ruby-doc core: Float).
5353

@@ -56,9 +56,9 @@ Read more about Float here: (ruby-doc core: Float).
5656
A *Rational* represents a rational number (a paired integer number a/b, where b > 0).
5757
You 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

6363
Read more about Rational here: (ruby-doc core: Rational).
6464

@@ -67,10 +67,10 @@ Read more about Rational here: (ruby-doc core: Rational).
6767
A *Complex* represents a complex number.
6868
You 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

7575
Read more about Complex here: (ruby-doc core: Complex).
7676

2_Numbers/2_Basic_operators/task.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ share the following basic operator methods:
2020
You can apply these arithmetic operators by writing one of them between two
2121
numbers, e.g.:
2222

23-
` 3.2 + 7` # => 10.2
24-
` Rational(2, 3) - Rational(1, 2)` # => (1/6)
25-
` 3 \* 5` # => 15
26-
` Complex(2.0, 4) / Complex(4.0, 2.0)` # => (0.8+0.6000000000000001i)
27-
` 2 \*\* 3` # => 8
23+
` 3.2 + 7` *# => 10.2*
24+
` Rational(2, 3) - Rational(1, 2)` *# => (1/6)*
25+
` 3 \* 5` *# => 15*
26+
` Complex(2.0, 4) / Complex(4.0, 2.0)` *# => (0.8+0.6000000000000001i)*
27+
` 2 \*\* 3` *# => 8*
2828

2929
## "Strange" behaviours
3030

@@ -40,9 +40,9 @@ down *Integer* value (`5 / 2` equals *2*, `7 / 2` equals *3*).
4040
To get a floating point number you have to use a *Float* for either the numerator
4141
or the denominator or for both of them, i.e.:
4242

43-
` 3.0 / 7` # => 0.42857142857142855
44-
` 3 / 7.0` # => 0.42857142857142855
45-
` 3.0 / 7.0` # => 0.42857142857142855
43+
` 3.0 / 7` *# => 0.42857142857142855*
44+
` 3 / 7.0` *# => 0.42857142857142855*
45+
` 3.0 / 7.0` *# => 0.42857142857142855*
4646

4747
The inaccuracy when summing up *Floats* appears beacause a *Float* is an approximation
4848
of a decimal number. Since floating point numbers are stored in binary in your

2_Numbers/3_Converting_numbers/task.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ Note that the size of the fraction doesn't matter:
2929
` 2.01.to_i` and `2.95.to_i` will both return *2*.
3030

3131
If you want to convert a float to an integer based on its digits after the decimal point,
32-
you should have a look at the `#floor`, `#ceil`, and `#round` methods of a Numeric:
32+
you should have a look at the following methods of a Numeric:
3333

34-
- (ruby-doc core: Numeric#ceil)
35-
- (ruby-doc core: Numeric#floor)
36-
- (ruby-doc core: Numeric#round)
34+
` #ceils`: (ruby-doc core: Numeric#ceil)
35+
` #floor`: (ruby-doc core: Numeric#floor)
36+
` #round`: (ruby-doc core: Numeric#round)
3737

3838
One thing you can't do is converting a Complex number with an imaginary part other
3939
than `0` to an integer, float, or rational number.
@@ -54,3 +54,5 @@ Store each result in a variable that is named like the resulting type of the con
5454
for 1. *integer*,
5555
for 2. *float*,
5656
and so on.
57+
58+
---

0 commit comments

Comments
 (0)