From: Daniel Berger Date: 2006-08-11T06:53:00+09:00 Subject: Confused by Bignum#remainder Help a guy out who got B's and C's in math classes in college: Ruby 1.8.4 on Solaris 10: irb(main):013:0> -1234567890987654321.remainder(13731) => -6966 irb(main):014:0> -1234567890987654321.remainder(13731.24) => -9906.22531493148 irb(main):015:0> -1234567890987654321.modulo(13731) => 6765 irb(main):016:0> -1234567890987654321.modulo(13731.24) => 3825.01468506852 Basically, I'm trying to figure out the nuances of Bignum#remainder vs Bignum#modulo. To confuse myself even further K&R (2nd ed, p. 41) says you can't do modulus on double or long, and that the sign result is machine dependent for negative operands. Can someone explain the subtleties of this to me (or point me to a link that does)? An archive search didn't reveal anything obvious. Perhaps the documentation in bignum.c needs further exposition? Or should I just *know* this? Thanks, Dan PS - I did try to read over the bigdivrem() private function in bignum.c but, like, whoa. This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.