OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [newlib/] [libm/] [mathfp/] [s_isinf.c] - Blame information for rev 56

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 56 joel
 
2
/* @(#)z_isinf.c 1.0 98/08/13 */
3
/******************************************************************
4
 * isinf
5
 *
6
 * Input:
7
 *   x - pointer to a floating point value
8
 *
9
 * Output:
10
 *   An integer that indicates if the number is infinite.
11
 *
12
 * Description:
13
 *   This routine returns an integer that indicates if the number
14
 *   passed in is infinite (1) or is finite (0).
15
 *
16
 *****************************************************************/
17
 
18
#include "fdlibm.h"
19
#include "zmath.h"
20
 
21
#ifndef _DOUBLE_IS_32BITS
22
 
23
int isinf (double x)
24
{
25
  __uint32_t lx, hx;
26
  int exp;
27
 
28
  EXTRACT_WORDS (hx, lx, x);
29
  exp = (hx & 0x7ff00000) >> 20;
30
 
31
  if ((exp == 0x7ff) && ((hx & 0xf0000 || lx) == 0))
32
    return (1);
33
  else
34
    return (0);
35
}
36
 
37
#endif /* _DOUBLE_IS_32BITS */

powered by: WebSVN 2.1.0

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