Type:
Class

When mathn is required, Fixnum's division and exponentiation are enhanced to return more precise values from mathematical expressions.

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

A Fixnum holds Integer values that can be represented in a native machine word (minus 1 bit). If any operation on a Fixnum exceeds this range, the value is automatically converted to a Bignum.

Fixnum objects have immediate value. This means that when they are assigned or passed as parameters, the actual object is passed, rather than a reference to that object. Assignment does not alias Fixnum objects. There is effectively only one Fixnum object instance for any given integer value, so, for example, you cannot add a singleton method to a Fixnum.

to_s

fix.to_s(base=10) â string Instance Public methods Returns a string containing

2015-04-07 00:31:07
<=>

fix numeric â -1, 0, +1 or nil Instance Public methods ComparisonâReturns

2015-04-06 22:59:16
===

fix == other â true or false Instance Public methods Return true

2015-04-06 23:05:39
>=

fix >= real â true or false Instance Public methods Returns true

2015-04-06 23:12:09
divmod

fix.divmod(numeric) â array Instance Public methods See Numeric#divmod

2015-04-06 23:46:40
*

fix * numeric â numeric_result Instance Public methods Performs multiplication:

2015-04-06 22:16:49
to_f

fix.to_f â float Instance Public methods Converts fix to a Float

2015-04-07 00:27:25
modulo

fix.modulo(other) â real Instance Public methods Returns fix

2015-04-07 00:15:02
&

fix & integer â integer_result Instance Public methods Bitwise AND.

2015-04-06 22:14:37
==

fix == other â true or false Instance Public methods Return true

2015-04-06 23:04:37