This is a Ruby tree! It shows every object from the Ruby Programming Language in a tree format.

modulo

        # Float.modulo

(from ruby core)
---
    modulo(p1)

---

Returns `self` modulo `other` as a float.

For float `f` and real number `r`, these expressions are equivalent:

    f % r
    f-r*(f/r).floor
    f.divmod(r)[1]

See Numeric#divmod.

Examples:

    10.0 % 2              # => 0.0
    10.0 % 3              # => 1.0
    10.0 % 4              # => 2.0

    10.0 % -2             # => 0.0
    10.0 % -3             # => -2.0
    10.0 % -4             # => -2.0

    10.0 % 4.0            # => 2.0
    10.0 % Rational(4, 1) # => 2.0

Float#modulo is an alias for Float#%.


(This method is an alias for Float#%.)

Returns `self` modulo `other` as a float.

For float `f` and real number `r`, these expressions are equivalent:

    f % r
    f-r*(f/r).floor
    f.divmod(r)[1]

See Numeric#divmod.

Examples:

    10.0 % 2              # => 0.0
    10.0 % 3              # => 1.0
    10.0 % 4              # => 2.0

    10.0 % -2             # => 0.0
    10.0 % -3             # => -2.0
    10.0 % -4             # => -2.0

    10.0 % 4.0            # => 2.0
    10.0 % Rational(4, 1) # => 2.0

Float#modulo is an alias for Float#%.



      

This is MURDOC! A Ruby documentation browser inspired by Smalltalk-80. It allows you to learn about Ruby by browsing through its class hierarchies, and see any of its methods.