This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: IS_INF bug?


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]