This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] pa-RISC correct conversion (long double -> unsigned int)


Richard Henderson wrote:
> 
> On Mon, Feb 26, 2001 at 02:21:55PM -0500, Will Cohen wrote:
> >       * gcc.c-torture/execute/20010226-1.c: New test.
> 
> This would need to go in the ieee subdirectory.
> 
> > #include <stdio.h>
> 
> You don't need to include this.
> 
> r~

Are these acceptable?

2001-02-26  Will Cohen  <wcohen@redhat.com>

	* gcc.c-torture/execute/ieee/20010226-1.c: New test.
long double dfrom = 1.1;
long double m1;
long double m2;
unsigned long mant_long;

int main( )
{
  m1 = dfrom / 2.0;

  m2 = m1 * 4294967296.0;
  mant_long = ((unsigned long) m2) & 0xffffffff;

  if ( mant_long == 0x8ccccccc)
    exit (0);
  else
    abort();
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]