From: "John W. Eaton" <jwe@bevo.che.wisc.edu>
Cc: guile-devel@gnu.org
Subject: Re: guile-core-20020426 and IEEE 754 arithmetic
Date: Thu, 16 May 2002 10:17:47 -0500 [thread overview]
Message-ID: <15587.52635.237623.334543@segfault.bogus.domain> (raw)
In-Reply-To: <CMM.0.92.0.1021554401.beebe@plot79.math.utah.edu>
On 16-May-2002, Nelson H. F. Beebe <beebe@math.utah.edu> wrote:
| guile-core-20020426 (1.5.6):
| guile> -0.0
| 0.0 !WRONG
| guile> (- 0.0)
| 0.0 !WRONG
| guile> (/ -1 (/ 1.0 0.0))
| 0.0 !WRONG
With the following patch, guile produces
guile> -0.0
0.0
guile> (- 0.0)
-0.0
guile> (/ -1 (/ 1.0 0.0))
-0.0
It looks like guile is dropping the sign on input. I would have tried
to fix that problem too, but I couldn't figure out where the string ->
double conversion takes place.
jwe
ChangeLog:
2002-05-16 John W. Eaton <jwe@bevo.che.wisc.edu>
* configure.in (AC_CHECK_FUNCS): Check for copysign.
libguile/ChangeLog:
2002-05-16 John W. Eaton <jwe@bevo.che.wisc.edu>
* numbers.c (idbl2str): Don't omit sign when printing negative zero.
--- configure.in 2002/05/16 15:04:05 1.1
+++ configure.in 2002/05/16 15:03:54
@@ -505,7 +505,7 @@
AC_CHECK_HEADERS(floatingpoint.h ieeefp.h nan.h)
-AC_CHECK_FUNCS(finite isinf isnan)
+AC_CHECK_FUNCS(finite isinf isnan copysign)
# When testing for the presence of alloca, we need to add alloca.o
# explicitly to LIBOBJS to make sure that it is translated to
--- libguile/numbers.c 2002/05/16 15:01:34 1.1
+++ libguile/numbers.c 2002/05/16 15:02:45
@@ -2076,7 +2076,16 @@
int exp = 0;
if (f == 0.0)
- goto zero; /*{a[0]='0'; a[1]='.'; a[2]='0'; return 3;} */
+ {
+#ifdef HAVE_COPYSIGN
+ double sgn = copysign (1.0, f);
+
+ if (sgn < 0.0)
+ a[ch++] = '-';
+#endif
+
+ goto zero; /*{a[0]='0'; a[1]='.'; a[2]='0'; return 3;} */
+ }
if (xisinf (f))
{
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2002-05-16 15:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-16 13:06 guile-core-20020426 and IEEE 754 arithmetic Nelson H. F. Beebe
2002-05-16 15:17 ` John W. Eaton [this message]
2002-05-22 13:36 ` Marius Vollmer
-- strict thread matches above, loose matches on Subject: below --
2002-05-08 19:02 Nelson H. F. Beebe
2002-05-16 5:12 ` John W. Eaton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15587.52635.237623.334543@segfault.bogus.domain \
--to=jwe@bevo.che.wisc.edu \
--cc=guile-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).