source: trunk/libs/libmath/s_finite.c @ 480

Last change on this file since 480 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: 811 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 * finite(x) returns 1 is x is finite, else 0;
18 * no branching!
19 */
20
21#include "math.h"
22#include "math_private.h"
23
24int isfinite(double x)
25{
26        uint32_t hx;
27
28        GET_HIGH_WORD(hx, x);
29        /* Finite numbers have at least one zero bit in exponent. */
30        /* All other numbers will result in 0xffffffff after OR: */
31        return (hx | 0x800fffff) != 0xffffffff;
32}
33
Note: See TracBrowser for help on using the repository browser.