OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [libm/] [common/] [sf_fdim.c] - Blame information for rev 345

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
/* Copyright (C) 2002 by  Red Hat, Incorporated. All rights reserved.
2
 *
3
 * Permission to use, copy, modify, and distribute this software
4
 * is freely granted, provided that this notice is preserved.
5
 */
6
 
7
#include "fdlibm.h"
8
 
9
#ifdef __STDC__
10
        float fdimf(float x, float y)
11
#else
12
        float fdimf(x,y)
13
        float x;
14
        float y;
15
#endif
16
{
17
  int c = __fpclassifyf(x);
18
  if (c == FP_NAN)  return(x);
19
  if (__fpclassifyf(y) == FP_NAN)  return(y);
20
  if (c == FP_INFINITE)
21
    return HUGE_VALF;
22
 
23
  return x > y ? x - y : 0.0;
24
}
25
 
26
#ifdef _DOUBLE_IS_32BITS
27
 
28
#ifdef __STDC__
29
        double fdim(double x, double y)
30
#else
31
        double fdim(x,y)
32
        double x;
33
        double y;
34
#endif
35
{
36
  return (double) fdimf((float) x, (float) y);
37
}
38
 
39
#endif /* defined(_DOUBLE_IS_32BITS) */

powered by: WebSVN 2.1.0

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