From: Daniel Carrera Date: 2003-06-20T01:22:42+09:00 Subject: Re: Weird Fixnum division -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I can't replicate your output. It works correctly for me. I am using Ruby 1.8.0, which version do you have? On Fri, Jun 20, 2003 at 01:18:33AM +0900, Tore Haug-Warberg wrote: > Hi, > > I'm new to this group but have used Ruby for quite a while now (it's a > great language by the way). In one of my methods I intend to divide a > Fixnum by a second Fixnum. I'd expected a Fixnum result but get Float back. > Can anyone give me an idea of what's wrong? The code looks like this: > > puts @m.class > puts d.class > puts @m > puts d > @m /= d > puts @m.class > puts d.class > puts @m > puts d > > and the output is: > > Fixnum > Fixnum > 8 > 1 > Float > Fixnum > 8.0 > 1 > > Yours, Tore Haug-Warberg > - -- Daniel Carrera | OpenPGP fingerprint: Graduate TA, Math Dept | 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88 UMD (301) 405-5137 | http://www.math.umd.edu/~dcarrera/pgp.html -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (SunOS) iD8DBQE+8eNLnxE8DWHf+OcRAkfxAJ9HkdSA06f0MuZ7BOSFrKwaUdUk8gCfcA9i dHpea8WiVlTf0L/qS89+K+o= =daoY -----END PGP SIGNATURE-----