Back to index

glibc  2.9
Functions
ots_cvtxq.c File Reference
#include "local-soft-fp.h"

Go to the source code of this file.

Functions

long _OtsCvtXQ (long al, long ah, long _round)

Function Documentation

long _OtsCvtXQ ( long  al,
long  ah,
long  _round 
)

Definition at line 25 of file ots_cvtxq.c.

{
  FP_DECL_EX;
  FP_DECL_Q(A);
  unsigned long r;
  long s;

  /* If bit 3 is set, then integer overflow detection is requested.  */
  s = _round & 8 ? 1 : -1;
  _round = _round & 3;

  FP_INIT_ROUNDMODE;
  FP_UNPACK_RAW_Q(A, a);
  FP_TO_INT_Q(r, A, 64, s);

  if (s > 0 && (_fex &= FP_EX_INVALID))
    FP_HANDLE_EXCEPTIONS;

  return r;
}