what is the type of PI, cos in Ruby
ruby, ruby-on-rails
Solution
puts Math::PI
#=> 3.141592653589793
include Math
puts PI.class
#=> Float
require "bigdecimal/math"
include BigMath
puts PI(50).class
#=> BigDecimal
puts PI(50)
#=> 0.3141592653589793238462643383279502884197169399375105820974944592309049629352442819E1
Problem
I want to ask about the type of PI and cos with Ruby. What is the convention to write these types? Can I write like: `Math::sin`, `Math::PI` or `Math.sin`, `Math.PI`?