chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] Adding checks to some procedures that accept i


From: Peter Bex
Subject: [Chicken-hackers] [PATCH] Adding checks to some procedures that accept integers only
Date: Sat, 7 Apr 2012 15:21:34 +0200
User-agent: Mutt/1.4.2.3i

Hi all,

Here's a patch that adds some tests for odd?, even?, lcm, gcd, quotient,
modulo, remainder and arithmetic-shift.

According to R5RS and R7RS odd?, even?, lcm, gcd, quotient, modulo and
remainder accept only integer values (which may be inexact).

Also, these procedures shouldn't accept +inf.0 or +nan.0 and, in case of
arithmetic-shift, odd? and even?, convert them to some unknown value
(looks like it's 0, but that's probably a C compiler/hardware detail).

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth

Attachment: 0001-Add-tests-for-inf-and-nan-values-to-even-odd-arithme.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]