From: Konrad Meyer Date: 2007-11-18T04:45:39+09:00 Subject: Re: How to avoid Fixnum rounding error --nextPart2977261.IK3ZfsOHbY Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Quoth Jari Williamsson: > Which is the best approach to avoid division rounding errors when=20 > performing integer division with a Fixnum? Is there any built-in method=20 > for this? >=20 > Best regards, >=20 > Jari Williamsson Convert an argument to float before doing the operation. 5 / 2 # =3D> 2 5.to_f / 2 # =3D> 2.5 HTH, =2D-=20 Konrad Meyer http://konrad.sobertillnoon.com/ --nextPart2977261.IK3ZfsOHbY Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBHP0TgCHB0oCiR2cwRAm3rAJ9OQIeudNzws6yjpf49XUylfEUEHQCfWDu1 k/uZUcAZLMrNGvlLtJpKwsg= =TNW4 -----END PGP SIGNATURE----- --nextPart2977261.IK3ZfsOHbY--