NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: port-alpha/48782 (# top [1] Floating point exception (core dumped) top)
The following reply was made to PR port-alpha/48782; it has been noted by GNATS.
From: "Naruaki.Etomi" <nullnilaki%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: martin%netbsd.org@localhost, port-alpha-maintainer%netbsd.org@localhost
Subject: Re: port-alpha/48782 (# top [1] Floating point exception (core
dumped) top)
Date: Wed, 21 May 2014 02:14:22 +0900
Dear martin,
I carry out a test on current version.
(__KERNEL_RCSID(0, "$NetBSD: fp_complete.c,v 1.21 2014/05/19 07:09:10
matt Exp $");)
$ uname -a
NetBSD 6.99.42 NetBSD 6.99.42 (GENERIC-$Revision: 1.358 $) #0: Tue
May 20 12:29:46 UTC 2014
naruaki@:/usr/obj.alpha/sys/arch/alpha/compile/GENERIC alpha
NaN
--------------------
#include<stdio.h>
#include <math.h>
int main(void){
double a, b;
a = 0.0 / 0.0;
printf("a=%lf isnan=%d\n", a, isnan(a));
b = 1.0 + a;
printf("b=%lf\n", b);
return 0;
}
NetBSD
----------
$ gcc -mieee-with-inexact -lm test1.c
$ ./a.out
a=nan isnan=1
b=nan
Tru64 UNIX
----------
ds15> cc -ieee_with_inexact -lm test1.c
cc: Warning: test1.c, line 6: In this statement, floating-point
overflow occurs in evaluating the expression "0.0/0.0". (floatoverfl)
a = 0.0 / 0.0;
----^
ds15> ./a.out
a=NaNQ isnan=1
b=NaNQ
--------------------
Infinity
--------------------
#include <stdio.h>
#include <math.h>
int main(void){
double a, b;
a = 1.0 / 0.0;
printf("a=%lf isinf=%d\n", a, isinf(a));
b = 1.0 / a;
printf("b=%lf\n", b);
return 0;
}
NetBSD
----------
$ gcc -mieee-with-inexact -lm test2.c
$ ./a.out
a=inf isinf=1
b=0.000000
Tru64 UNIX
----------
Tru64 UNIX is not implemented isinf()
--------------------
Signed zero
--------------------
#include <stdio.h>
#include <math.h>
int main(void){
double a, b, c, d;
a = 1.0 / 0.0;
b = -1.0 / 0.0;
printf("a=%lf b=%lf\n", a, b);
c = 1.0 / a;
d = 1.0 / b;
printf("c = %lf d = %lf\n", c, d);
printf("ans1=%lf, and2=%lf\n", 1.0 / c, 1.0 / d);
return 0;
}
NetBSD
----------
$ gcc -mieee-with-inexact -lm test3.c
$ ./a.out
a=inf b=-inf
c = 0.000000 d = -0.000000
ans1=inf, and2=-inf
Tru64 UNIX
----------
ds15> cc -ieee_with_inexact -lm test3.c
cc: Warning: test3.c, line 6: In this statement, division by zero
occurs in evaluating the expression "1.0/0.0". (zerodiv)
a = 1.0 / 0.0;
----^
cc: Warning: test3.c, line 7: In this statement, division by zero
occurs in evaluating the expression "-1.0/0.0". (zerodiv)
b = -1.0 / 0.0;
----^
ds15> ./a.out
a=INF b=-INF
c = 0.000000 d = -0.000000
ans1=INF, and2=-INF
--------------------
I think that the problem was solved.
Your work is wonderful!
Of course, Userland application(e.g., /pkgsrc/net/mikutter) work fine!
https://twitter.com/nullnilaki/status/468744417319206912/photo/1
That's very nice of you!
--
Naruaki Etomi / nullnilaki%gmail.com@localhost
Home |
Main Index |
Thread Index |
Old Index