[Top][All Lists]

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

Re: [Chicken-hackers] Dropping SunCC and Solaris 9

From: Peter Bex
Subject: Re: [Chicken-hackers] Dropping SunCC and Solaris 9
Date: Sun, 21 Apr 2013 16:19:30 +0200
User-agent: Mutt/

On Sat, Apr 20, 2013 at 09:25:05PM +0200, Michele La Monaca wrote:
> Indeed it's for an old Solaris version. I'm ok if you don't want to
> include patches for old platforms. Anyway, a correct build for Solaris
> 9 is only a couple of math functions away, so I think it is still
> reasonable. Up to you. I've pasted the patch at
> for users which might need it (very few I guess). It would need some
> tweaking as Florian pointed out but if it's not going to be included I
> don't care about floating numbers.

If you want to make a change, at least test your patches first!
The implementation you posted fails a basic "make check":

Error: assertion failed: (= -43.0 (fpround -42.5))

That's because C's round() is supposed to round away from zero.
(remember: you must install first before "make check" will work)

Our tests for truncate appear to be pretty incomplete.  Your
implementation of trunc passes the tests, but it fails at least
for negative numbers:

#;1> (truncate 1.0)
#;2> (truncate -1.0)

A correct version of round looks more like this:

And a correct version of trunc looks like this (I have no idea
if all this bit twiddling is really required):

I think all this is a little too complicated to include, just for the
sake of supporting an EOLed platform.  I'll let others decide on whether
it's still worth it.


reply via email to

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