From: David Vallner Date: 2006-10-01T01:08:34+09:00 Subject: Re: Integer division with / - request explanation of behavior --------------enigBE3685E78261E5627E61446A Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Wes Gamble wrote: > Today I discovered the difference in the meaning of the / (arithmetic=20 > divide) method depending on whether it's caller is an integer or a=20 > float. >=20 > I discovered that I had to cast the calling number explicitly to a floa= t=20 > and it seemed totally non-intuitive to me. >=20 The mathn namespace-clobbering module makes maths work like expected. The magic lies in aliasing Fixnum#/ to Fixnum#quo (same for Bignum). You could use that method explicitly, or just clobber the classes if you're sure nothing else expects the C meaning to work. --------------enigBE3685E78261E5627E61446A Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (MingW32) iD8DBQFFHpaEy6MhrS8astoRAkxzAJ9GB5R5mQzlyYBcEoysEbEeNDw/FwCeO921 nqgSqd4cQbfjq+iXwxPhX+I= =bDDP -----END PGP SIGNATURE----- --------------enigBE3685E78261E5627E61446A--