source: trunk/libs/libmath/s_isnan.c @ 496

Last change on this file since 496 was 469, checked in by alain, 6 years ago

1) Introduce the libsemaphore library.
2) Introduce a small libmath library, required by the "fft" application..
3) Introduce the multithreaded "fft" application.
4) Fix a bad synchronisation bug in the Copy-On-Write mechanism.

File size: 753 bytes
Line 
1/*
2 * ====================================================
3 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
4 *
5 * Developed at SunPro, a Sun Microsystems, Inc. business.
6 * Permission to use, copy, modify, and distribute this
7 * software is freely granted, provided that this notice
8 * is preserved.
9 * ====================================================
10 */
11
12/*
13 * Modified for ALMOS-MKH OS at UPMC, France, August 2018. (Alain Greiner)
14 */
15
16
17/*
18 * isnan(x) returns 1 is x is nan, else 0;
19 * no branching!
20 */
21
22#include "math.h"
23#include "math_private.h"
24
25int isnan(double x)
26{
27        int32_t hx,lx;
28        EXTRACT_WORDS(hx,lx,x);
29        hx &= 0x7fffffff;
30        hx |= (uint32_t)(lx|(-lx))>>31;
31        hx = 0x7ff00000 - hx;
32        return (int)(((uint32_t)hx)>>31);
33}
Note: See TracBrowser for help on using the repository browser.