Beispiel #1
0
DEC_TYPE
INTERNAL_FUNCTION_NAME (DEC_TYPE x)
{
  DEC_TYPE z = IEEE_FUNCTION_NAME (x);
  if (!FUNC_D(__isfinite) (z) && FUNC_D(__isfinite) (x))
    DFP_ERRNO (ERANGE);
  return z;
}
Beispiel #2
0
DEC_TYPE
INTERNAL_FUNCTION_NAME (DEC_TYPE x)
{
  DEC_TYPE z = IEEE_FUNCTION_NAME (x);
  if (x > DFP_CONSTANT(1.0) || x < DFP_CONSTANT(-1.0))
    DFP_ERRNO (EDOM);
  return z;
}
Beispiel #3
0
__ROUND_RETURN_TYPE
INTERNAL_FUNCTION_NAME (DEC_TYPE x)
{
  __ROUND_RETURN_TYPE z = IEEE_FUNCTION_NAME (x);
  if (FUNC_D(__isnan) (x) || FUNC_D(__isinf) (x)
	|| x > __MAX_VALUE || x < __MIN_VALUE)
    DFP_ERRNO (EDOM);
  return z;
}
Beispiel #4
0
DEC_TYPE
INTERNAL_FUNCTION_NAME (DEC_TYPE x)
{
  DEC_TYPE z = IEEE_FUNCTION_NAME (x);
  if (!FUNC_D(__isfinite) (z) && FUNC_D(__isfinite) (x))
    DFP_ERRNO (ERANGE);
  if (x < DFP_CONSTANT(0.0) && (FUNC_D (__isinf) (x) && FUNC_D (__rint) (x) == x) )
    DFP_ERRNO (EDOM);
  return z;
}
Beispiel #5
0
DEC_TYPE
INTERNAL_FUNCTION_NAME (DEC_TYPE x)
{
  DEC_TYPE z = IEEE_FUNCTION_NAME (x);
  if (x == DFP_CONSTANT(0.0))
    DFP_ERRNO (ERANGE);
  if (x < DFP_CONSTANT(0.0))
    DFP_ERRNO (EDOM);
  return z;
}
Beispiel #6
0
DEC_TYPE
INTERNAL_FUNCTION_NAME (DEC_TYPE x)
{
  DEC_TYPE z = IEEE_FUNCTION_NAME (x);
  if (x < DFP_CONSTANT(-1.0) || x > DFP_CONSTANT(1.0))
    DFP_ERRNO (EDOM);
  /* The normal glibc ieee754 k_standard.c file does not follow c99 or POSIX
   * with regard to atanh pole errors. atan(+-1.0) [the binary version] will
   * set errno to EDOM.  Hopefully this will get worked out soon. */
  if (x == DFP_CONSTANT(-1.0) || x == DFP_CONSTANT(1.0))
    DFP_ERRNO (ERANGE);
  return z;
}
Beispiel #7
0
DEC_TYPE
INTERNAL_FUNCTION_NAME (DEC_TYPE x, DEC_TYPE y)
{
  DEC_TYPE z = IEEE_FUNCTION_NAME (x, y);
  /* Pole error: x = 0, y < 0 (non-inf). Set ERANGE in accordance with C99 */
  if (x == DFP_CONSTANT(0.0) && FUNC_D(__isfinite)(y) && y < DFP_CONSTANT(0.0))
      DFP_ERRNO (ERANGE);
  if (!FUNC_D(__isfinite) (z) && FUNC_D(__isfinite) (x) && FUNC_D(__isfinite) (y))
    {
      if (FUNC_D(__isnan) (z)) /*  Domain error was triggered, x < 0 and y was not an
			odd int */
	DFP_ERRNO (EDOM);
      else	/*  Overflow */
	DFP_ERRNO (ERANGE);
    }
  return z;
}