Euler and PI : Math.constants « Development « Ruby






Euler and PI


print Math::E # => 2.71828182845905
print Math::PI # => 3.14159265358979

 

Related examples in the same category

1.To find out what constants Math (or any other module or class) has defined, use reflection by invoking the constants method
2.Math.const_set and get