]> Git Repo - uclibc-ng.git/blame - libm/s_isinf.c
quieten compiler warnings when __UCLIBC_HAS_FENV__ isn't defined
[uclibc-ng.git] / libm / s_isinf.c
CommitLineData
0e05d982
BRF
1/*
2 * Written by J.T. Conklin <[email protected]>.
3 * Changed to return -1 for -Inf by Ulrich Drepper <[email protected]>.
4 * Public domain.
5 */
6
0e05d982
BRF
7/*
8 * isinf(x) returns 1 is x is inf, -1 if x is -inf, else 0;
9 * no branching!
10 */
11
12#include "math.h"
13#include "math_private.h"
14
38b7304e 15int __isinf(double x)
0e05d982
BRF
16{
17 int32_t hx,lx;
18 EXTRACT_WORDS(hx,lx,x);
19 lx |= (hx & 0x7fffffff) ^ 0x7ff00000;
20 lx |= -lx;
21 return ~(lx >> 31) & (hx >> 30);
22}
40b8158b 23libm_hidden_def(__isinf)
This page took 0.085767 seconds and 4 git commands to generate.