guile-user
[Top][All Lists]
Advanced

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

Re: Questions about floating numbers and call-with-current-continuation


From: Keith Wright
Subject: Re: Questions about floating numbers and call-with-current-continuation
Date: Wed, 5 Sep 2001 00:48:57 -0400

> From: Ying Luo <address@hidden>
> 
> I have some question about floating numbers in guile-1.4,
> which has annoyed me for quite a few times :(
> 
> Below is listed two of  the commands I typed in and got incorrect
> results:
> guile> (truncate (* 2127.7 100))
> 212769.0
> guile> (zero? (- 264 (* 2.64 100)))
> #f

This is how it is with binary floating point, it has
nothing much to do with Guile.  You need to sign up
for Numerical Analysis 101.  If you want exact results,
you don't use floating point.

-- 
     -- Keith Wright  <address@hidden>

Programmer in Chief, Free Computer Shop <http://www.free-comp-shop.com>
         ---  Food, Shelter, Source code.  ---



reply via email to

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