D
D
DiaTMs2019-01-06 02:18:50
ruby
DiaTMs, 2019-01-06 02:18:50

Where to get and how to connect the Math library to Ruby?

require 'mathn'

puts Math.sqrt(4 / 9)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nathanael, 2019-01-06
@DiaTMs

Math should be enabled by default,
You can check in IRB:

> irb
2.4.3 :001 > Math # без require
 => Math
2.4.3 :002 > Math.sqrt 4
 => 2.0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question