klisp

an open source interpreter for the Kernel Programming Language.
git clone http://git.hanabi.in/repos/klisp.git
Log | Files | Refs | README

commit e49757f7b83a3eea22431a0d9b759087024c80d0
parent 850c4b89790ccacf06b115e9e2e042cce1d435a4
Author: Oto Havle <havleoto@gmail.com>
Date:   Fri, 21 Oct 2011 07:42:55 +0200

Merged recent fixed from the original repository.

Diffstat:
Msrc/imath.c | 3++-
Msrc/tests/numbers.k | 12++++--------
2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/imath.c b/src/imath.c @@ -3228,7 +3228,8 @@ STATIC mp_result s_udiv(klisp_State *K, mp_int a, mp_int b) mp_word pfx = r.digits[r.used - 1]; mp_word qdigit; - if(r.used > 1 && pfx <= btop) { + // Bugfix (was pfx <= btop in imath <= 1.17) Andres Navarro + if(r.used > 1 && pfx < btop) { pfx <<= MP_DIGIT_BIT / 2; pfx <<= MP_DIGIT_BIT / 2; pfx |= r.digits[r.used - 2]; diff --git a/src/tests/numbers.k b/src/tests/numbers.k @@ -1,6 +1,6 @@ ;; check.k & test-helpers.k should be loaded ;; -;; I fixed a number of bugs and added some rationale to some of the tests +;; I fixed all of the bugs and added some rationale to some of the tests ;; marked as FAIL. In some cases, as you say, the specification is unclear. ;; In these cases I tried to include my interpretation (which could be wrong), ;; and changed the test to reflect this. @@ -10,13 +10,9 @@ ;; Shutt for clarification (but I warn you that while he is very cooperative ;; with this kind of things he sometimes takes a while to answer). ;; -;; The round thing is actually a bug in dtoa (kreal.c) the function that -;; converts doubles to strings and has nothing to do with rounding. -;; When the error msg was being generated the interpreter entered an infinite -;; loop in dtoa. -;; You can test this easily just entering 1.1 in the interpreter. -;; I'll have to work on this one. I'll have to reread the paper and work on it -;; with gdb. +;; The round thing was actually a bug in the IMath division routine +;; I fixed it (I think!) and have sent an email to the maintainer to +;; report the bug and hopefully confirm the correctness of the fix ;; ;; Andres Navarro ;;