Back to index

glibc  2.9
Functions
q_neg.c File Reference
#include "soft-fp.h"
#include "quad.h"

Go to the source code of this file.

Functions

long double _Q_neg (const long double a)

Function Documentation

long double _Q_neg ( const long double  a)

Definition at line 26 of file q_neg.c.

{
  FP_DECL_EX;
  long double c = a;
  
#if (__BYTE_ORDER == __BIG_ENDIAN)
  ((UWtype *)&c)[0] ^= (((UWtype)1) << (W_TYPE_SIZE - 1));
#elif (__BYTE_ORDER == __LITTLE_ENDIAN) && (W_TYPE_SIZE == 64)
  ((UWtype *)&c)[1] ^= (((UWtype)1) << (W_TYPE_SIZE - 1));
#elif (__BYTE_ORDER == __LITTLE_ENDIAN) && (W_TYPE_SIZE == 32)
  ((UWtype *)&c)[3] ^= (((UWtype)1) << (W_TYPE_SIZE - 1));
#else
  FP_DECL_Q(A); FP_DECL_Q(C);

  FP_UNPACK_Q(A, a);
  FP_NEG_Q(C, A);
  FP_PACK_Q(c, C);
#endif
  FP_CLEAR_EXCEPTIONS;
  FP_HANDLE_EXCEPTIONS;
  return c;
}