Different ways to do division in Ruby

This was always confusing me, since Ruby has many ways to perform the division. So, here’s a fresh quote by Matz himself:

We have /, div, fdiv, and quo:
  /     – normal division, according to the class of operands
div    – integer division
fdiv   – float division
quo   – most accurate division (float if either operand is float, otherwise rational)
rdiv   – (which always results in rational) is obsolete.

One Response to “Different ways to do division in Ruby”

  1. ламинат Says:

    2pGood idea.6r I compleatly agree with last post. ctq
    ламинированный паркет 0q

Leave a Reply