BUG - unsigned long cast to double
Matt Costello
matt at ncr-sd.SanDiego.NCR.COM
Wed Aug 31 13:03:23 AEST 1988
In article <1239500001 at osiris.cso.uiuc.edu> olson at osiris.cso.uiuc.edu writes:
>The problem involves casting unsigned long to double. The Pyramid and
>Masscomp compilers treat the cast as SIGNED long to double. If the
>value is large enough, you have troubles.
The problem has existed in PCC since the beginning, as the PDP-11
did not readily support 32 bit integers. The few double-word instructions,
including the floating point conversions, only supported signed values.
Neither the VAX nor the M68881 support conversions to or from unsigned
values either.
The code sequences to handle the unsigned long to double conversion
(and vice versa) would have imposed an unacceptable performace penalty,
so it wasn't done. I don't have my K&R here, but I don't even believe
that unsigned longs were legal back then.
--
Matt Costello <matt.costello at SanDiego.NCR.COM>
+1 619 485 2926 <matt.costello%SanDiego.NCR.COM at Relay.CS.NET>
{ucsd,att,pyramid,nosc.mil}!ncr-sd!matt
More information about the Comp.lang.c
mailing list