chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] bug and potential fix for numbers egg


From: John Cowan
Subject: Re: [Chicken-users] bug and potential fix for numbers egg
Date: Fri, 28 Mar 2008 13:13:31 -0400
User-agent: Mutt/1.5.13 (2006-08-11)

Alex Shinn scripsit:

> As a potential workaround, I've attached a patch which first
> checks if both the numerator and denominator fit within a
> long (there's no direct way to check if they fit in a
> double), and if so just uses the straight C operations
> 
>     (double) numerator / (double) denominator
> 
> which is more accurate than what GMP does!

I think that's the right general idea, but "long" can be 32 bits,
and often is; I think you need to use a system-dependent type that
can be guaranteed to be 64 bits (does Chicken have one?).

-- 
John Cowan  address@hidden   ccil.org/~cowan
Dievas dave dantis; Dievas duos duonos          --Lithuanian proverb
Deus dedit dentes; deus dabit panem             --Latin version thereof
Deity donated dentition;
  deity'll donate doughnuts                     --English version by Muke Tever
God gave gums; God'll give granary              --Version by Mat McVeagh




reply via email to

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