[Info-vax] are infinities working yet on x86?
Craig A. Berry
craigberry at nospam.mac.com
Fri Aug 25 16:34:50 EDT 2023
Apologies if this is a known problem but I didn't find anything in the
release notes that quite seemed to match. Consider the following
program and its output:
$ type powtest.c
#include <stdio.h>
#include <math.h>
#include <float.h>
#include <errno.h>
main()
{
double right = 1000.00000000000;
double left = DBL_MAX;
double x;
errno = 0;
x = pow(left, right);
printf("%d, %f\n", errno, x);
if (errno != 0) perror("pow");
printf("Is x infinity? %d\n", isinf(x));
}
$ cc powtest
$ link powtest
$ run powtest
34,
179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000.000000
pow: result too large
Is x infinity? 0
On Itanium, it returns "Infinity" instead of that really big number in
the first line and "1" instead of "0" in the last line for the return
value if isinf(x).
I'm running this with the new update 1 installed:
$ cc/vers
VSI C X7.4-785 (GEM 50X65) on OpenVMS x86_64 V9.2-1
More information about the Info-vax
mailing list