Subject: Re: +Infinity D_Float on VAX?
To: I. Souvatzis <ignatios@cs.uni-bonn.de>
From: Brian D Chase <bdc@world.std.com>
List: port-vax
Date: 03/29/1999 01:37:51
On Mon, 29 Mar 1999, I. Souvatzis wrote:

> There might be a basic problem. I'm not sure (my VAX Arch Ref Manual is
> at home) but ... is there any way to do this at all?

Not that I saw in the VARM :-)

> As far as I now, strange things like _representing_ +Infinity,
> -Infinity, and the result of dividing 0/0 in the data (instead of just
> signalling an error condition) are an invention of the IEEE floating
> point spec and weren't around on VAXen.

Well... maybe this is an issue of not representing +Infinity in libc's
__infinity.  But at the very least HUGE_VAL should be defined to be the
maximum value for a double float.  The <math.h> header has already done
this for the HUGE define.  Would there be any issues in defining
__infinity on the VAX to be this value as well?  I know it's not
quite equivalent to what's intended by the IEEE +Infinity.

I've no idea what to do about IEEE NAN.  The VARM does mention that when
you've an exponent of 0 taken with a sign bit of 1 is taken as reserved,
but that performing a floating point operation on a reserved FP operand
takes a reserved operand fault.

---

The max value for a VAX D_float is demonstrated in the following code
snippet.  BTW, this is only valid on a VAX.

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

const char f1[] = { (char)0xff, (char)0x7f, (char)0xff, (char)0xff,
                    (char)0xff, (char)0xff, (char)0xff, (char)0xff };

int main ()
{
    double f;

    f = *(double *)f1;
    printf("%lf\n", f);
    exit(0);
}


-brian.
---
Brian "JARAI" Chase | http://world.std.com/~bdc/ | VAXZilla LIVES!!!