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

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.17.0/] [newlib/] [libm/] [mathfp/] [sf_ispos.c] - Blame information for rev 617

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

Line No. Rev Author Line
1 148 jeremybenn
 
2
/* @(#)z_isposf.c 1.0 98/08/13 */
3
/******************************************************************
4
 * Positive value test
5
 *
6
 * Input:
7
 *   x - floating point value
8
 *
9
 * Output:
10
 *   An integer that indicates if the number is positive.
11
 *
12
 * Description:
13
 *   This routine returns an integer that indicates if the number
14
 *   passed in is positive (1) or negative (0).
15
 *
16
 *****************************************************************/
17
 
18
#include "fdlibm.h"
19
#include "zmath.h"
20
 
21
int isposf (float x)
22
{
23
  __int32_t wx;
24
 
25
  GET_FLOAT_WORD (wx, x);
26
 
27
  if (wx & 0x80000000)
28
    return (0);
29
  else
30
    return (1);
31
}
32
 
33
#ifdef _DOUBLE_IS_32BITS
34
 
35
int ispos (double x)
36
{
37
  return isposf ((float) x);
38
}
39
 
40
#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.