Support for the Ruby 2.4 series has ended. See here for reference.

In Files

  • mathn.rb

Parent

Class/Module Index [+]

Quicksearch

Integer

When mathn is required, Integer's division is enhanced to return more precise values from mathematical expressions.

2/3*3  # => 0
require 'mathn'
2/3*3  # => 2

(2**72) / ((2**70) * 3)  # => 4/3