chicken-janitors
[Top][All Lists]
Advanced

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

[Chicken-janitors] #1051: Implementation of C_flonum_rat is probably bug


From: Chicken Trac
Subject: [Chicken-janitors] #1051: Implementation of C_flonum_rat is probably buggy
Date: Thu, 05 Sep 2013 09:07:00 -0000

#1051: Implementation of C_flonum_rat is probably buggy
----------------------------+-----------------------------------------------
 Reporter:  felix           |       Owner:  sjamaan
     Type:  defect          |      Status:  new    
 Priority:  major           |   Milestone:  someday
Component:  core libraries  |     Version:  4.8.x  
 Keywords:  flonum_rat      |  
----------------------------+-----------------------------------------------
 It seems that a tagged flonum is interpreted as an integer:

 {{{
 void C_ccall C_flonum_rat(C_word c, C_word closure, C_word k, C_word n)
 {
   double frac, tmp, numer, denom, factor, fn = C_flonum_magnitude(n);
   double r1a, r1b;
   double ga, gb;
   C_word ab[WORDS_PER_FLONUM * 2], *ap = ab;
   int i = 0;

   if (n < 1 && n > -1) {                 <---
     factor = pow(2, DBL_MANT_DIG);
     fn *= factor;
   } else {
     factor = 1;
   }
   :
 }}}

 In the code snippet above `n` is access directly, it may be the case that
 `fn` is actually meant to be tested.

-- 
Ticket URL: <http://bugs.call-cc.org/ticket/1051>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.

reply via email to

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