This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: IS_INF bug?
- To: Ivan Toshkov <ivant at ifao dot net>
- Subject: Re: IS_INF bug?
- From: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Date: Wed, 10 May 2000 13:13:35 +0200 (MEST)
- cc: Guile Mailing List <guile at sourceware dot cygnus dot com>
On Wed, 10 May 2000, Ivan Toshkov wrote:
> why not
> #define IS_INF(x) ((!(x) && (x)=(x)/2))
> This ofcourse means that any side effect will be tripled (rather than
> doubled) but depending on such side effects is very errorprone.
Your suggestion would fix that macro, sure. However, since IS_INF is only
used in places where x != 0.0 is known (that's the reason the old solution
worked at all), the additional test is superfluous.
Since the handling of overflows and illegal values is broken throughout
numbers.c, it's no use to fix IS_INF. Instead, I think the right way to
go, as has been suggested, would be to test for the corresponding ieee
functions and use them if available, otherwise provide sensible defaults.
Sorry, but that's something that I can't do due to lacking autoconf
knowledge and not very deep knowledge of numerical problems.
However, numbers.c is _much_ cleaner and easier to understand now, thus
for some numeric guru it wouldn't be a problem to step in here and take
care of these issues.
Up to then, I will add a FIXME comment to IS_INF.
Thanks,
Dirk