Skip to content

Commit ccb8616

Browse files
committed
[DOC] using Math::N in examples
1 parent a20ac8e commit ccb8616

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Without mathn:
1313
With mathn:
1414

1515
```ruby
16+
require "mathn"
17+
using Math::N
1618
3 / 2 => 3/2 # Rational
1719
```
1820

@@ -27,14 +29,16 @@ Without mathn:
2729
With mathn:
2830

2931
```ruby
32+
require "mathn"
33+
using Math::N
3034
20 / 9 * 3 * 14 / 7 * 3 / 2 # => 20
3135
```
3236

3337
## Global Behavioral changes
3438

3539
While older version of 'mathn', just by required, caused changes to
3640
the behavior (and even the types) of operations on classes like
37-
Integer newer `mathn` introduces the refinements `Math::N`, and you
41+
Integer, newer `mathn` introduces the refinements `Math::N`, and you
3842
have to enable it.
3943

4044
Before ruby 2.5, `mathn` was part of the ruby standard library. It was

0 commit comments

Comments
 (0)