OpenCores
URL https://opencores.org/ocsvn/hf-risc/hf-risc/trunk

Subversion Repositories hf-risc

[/] [hf-risc/] [trunk/] [tools/] [riscv-gnu-toolchain-master/] [glibc/] [sysdeps/] [riscv/] [fpu/] [s_fdim.c] - Rev 13

Compare with Previous | Blame | View Log

#include <errno.h>
#include <math.h>
#include "fpu_control.h"
 
double __fdim (double x, double y)
{
  double diff = x - y;
 
  if (x <= y)
    return 0.0;
 
#ifdef __riscv_soft_float
  if (isinf(diff))
    errno = ERANGE;
#else
  if (__builtin_expect(_FCLASS(diff) & _FCLASS_INF, 0))
    errno = ERANGE;
#endif
 
  return diff;
}
weak_alias (__fdim, fdim)
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.