rationalize(r1, r2)
Return the simplest rational number that differs from r1 by no more than r2.
r1
r2
rationalize(3/10, 1/10) // 1/3 rationalize(.3, 1/10) // .3333333333333333
Core Module Index | Contents