8dd5186a0d
* First re-style was done automatically by indent to minimize the
chance of errors during rewrite.
* Manual changes were applied to non-critical places only (comments
and spaces):
* Replaced all tabs with spaces.
* Fixed tab stops in formulae in function comments.
(Note: ASCII art for math formulae (especially for super- and
subscripts) is a terrible idea.)
* Unified the style of function comments.
* Moved some in-code comments to their right places, which indent
couldn't handle.
* Added spaces to formulae of in-code comments to make them more
readable.
* Added braces mandated by jerry style guidelines.
* Added parentheses to multiline #ifdef.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
31 lines
700 B
C
31 lines
700 B
C
|
|
/* @(#)s_isnan.c 1.3 95/01/18 */
|
|
/*
|
|
* ====================================================
|
|
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
|
|
*
|
|
* Developed at SunSoft, a Sun Microsystems, Inc. business.
|
|
* Permission to use, copy, modify, and distribute this
|
|
* software is freely granted, provided that this notice
|
|
* is preserved.
|
|
* ====================================================
|
|
*/
|
|
|
|
/* isnan(x) returns 1 is x is nan, else 0;
|
|
* no branching!
|
|
*/
|
|
|
|
#include "fdlibm.h"
|
|
|
|
int
|
|
isnan (double x)
|
|
{
|
|
int hx, lx;
|
|
|
|
hx = (__HI (x) & 0x7fffffff);
|
|
lx = __LO (x);
|
|
hx |= (unsigned) (lx | (-lx)) >> 31;
|
|
hx = 0x7ff00000 - hx;
|
|
return ((unsigned) (hx)) >> 31;
|
|
} /* isnan */
|