At 10:02 AM -0400 6/14/02, Green, Paul wrote:
>Craig A. Berry [mailto:[EMAIL PROTECTED]] writes:
> > The pp_pack.c bit essentially steals Paul's VOS code for packing
>> floats and doubles but we don't have the same constants he does
>> (_float_constants, _double_constants) so  I couldn't simply share the
> > same code.
>
>But... your code and my code don't quite do the same thing... my version
>converts an out-of-range value to + or -infinity.  Your version converts the
>out-of-range value to + or -(FLT|DBL)_MAX.  IIRC, I picked infinity because
>that is how Solaris and Linux and other Unix OSes seemed to convert
>out-of-range values. 

I didn't pick infinity because in the cases where any help is needed
there is no such thing.

>However, doesn't VMS have both IEEE and non-IEEE floating-point formats?  Do
>either of them support infinities?  Should we try to collaborate on finding
>a common solution here?

On VAX, IEEE format is not available.  On Alpha, it's available and
we've made it the default, but people may configure not to use it if
they need binary compatibility with other formats.  If we are using
IEEE, we also select denormalization of results, which will do silent
underflow and overflow.  The case I've just added is to fake silent
overflow when we are not using IEEE, so the concepts of infinity,
NaN, and such aren't available.

If VOS is using the IEEE format but just doesn't implement
denormalization, I would think the infinity values you'd want to be
plugging in would be available in ieeefp.h as FP_POS_INF, FP_NEG_INF,
etc., but I'm far from an expert here.  To coordinate this we'd need
to use constants that Perl always knows about regardless of platform
or floating point format.  It looks like NV_INF would work for
doubles but I don't think there is anything corresponding to that for
singles.  In sum, I think we should punt until after 5.8.0 goes final.
-- 
________________________________________
Craig A. Berry
mailto:[EMAIL PROTECTED]

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser

Reply via email to