chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] Using fmt and numbers eggs together


From: Sudarshan S Chawathe
Subject: [Chicken-users] Using fmt and numbers eggs together
Date: Sat, 02 Jan 2016 11:40:47 -0500

I seem to get incorrect output and errors in some cases when using the
fmt and numbers eggs together.  A brief transcript illustrating the
problem is included below.  In brief:

  * (fix 30 2/3) doesn't behave as indicated in the docs.

  * Some large numbers cause errors.

When not using the numbers egg, fmt's behavior seems to be as expected
(given Chicken's implementation of numbers without the 'numbers' egg).

Is this a known limitation of fmt with 'numbers'?

Regards,

-chaw

$ csi -n

CHICKEN
(c) 2008-2014, The Chicken Team
(c) 2000-2007, Felix L. Winkelmann
Version 4.9.0.1 (stability/4.9.0) (rev 8b3189b)
linux-unix-gnu-x86 [ manyargs dload ptables ]
bootstrapped 2014-06-07

#;1> (use fmt)
; loading /home/chaw/local/lib/chicken/7/fmt.import.so ...
; loading /home/chaw/local/lib/chicken/7/chicken.import.so ...
; loading /home/chaw/local/lib/chicken/7/ports.import.so ...
; loading /home/chaw/local/lib/chicken/7/srfi-1.import.so ...
; loading /home/chaw/local/lib/chicken/7/srfi-69.import.so ...
; loading /home/chaw/local/lib/chicken/7/foreign.import.so ...
; loading /home/chaw/local/lib/chicken/7/srfi-13.import.so ...
; loading /home/chaw/local/lib/chicken/7/extras.import.so ...
; loading /home/chaw/local/lib/chicken/7/data-structures.import.so ...
; loading /home/chaw/local/lib/chicken/7/fmt.so ...
#;2> (fmt #f (fix 30 2/3))
"0.666666666666666600000000000000"
#;3> (fmt #f (num (- (expt 10 10))))
"-10000000000.0"
#;4> (use numbers)
; loading /home/chaw/local/lib/chicken/7/numbers.import.so ...
; loading /home/chaw/local/lib/chicken/7/numbers.so ...
#;5> (fmt #f (fix 30 2/3))
"2/3"
#;6> (fmt #f (num (- (expt 10 10))))

Error: (imag-part) bad argument type - not a number: -10000000000

        Call history:

        numbers.scm:1288: arithmetic-shift        
        numbers.scm:1413: g1762   
        numbers.scm:1288: lp      
        numbers.scm:1288: arithmetic-shift        
        numbers.scm:1413: g1762   
        numbers.scm:1288: lp      
        numbers.scm:1290: %*      
        numbers.scm:1290: %-      
        numbers.scm:1290: lp      
        numbers.scm:1248: %*      
        numbers.scm:1288: %*      
        numbers.scm:1248: %*      
        numbers.scm:1288: %*      
        numbers.scm:1248: %*      
        numbers.scm:1288: %*      
        numbers.scm:327: g283           <--
#;6> ,q

$ 



reply via email to

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