home *** CD-ROM | disk | FTP | other *** search
/ Game Zone - 1,000+ Games / GAMEZONE.BIN / Programs / PALM / Oh-One / src / s_signbit.c < prev    next >
C/C++ Source or Header  |  1997-08-16  |  1KB  |  35 lines

  1. // 15 August 1997, Rick Huebner:  Small changes made to adapt for MathLib
  2.  
  3. /* Return nonzero value if number is negative.
  4.    Copyright (C) 1997 Free Software Foundation, Inc.
  5.    This file is part of the GNU C Library.
  6.    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
  7.  
  8.    The GNU C Library is free software; you can redistribute it and/or
  9.    modify it under the terms of the GNU Library General Public License as
  10.    published by the Free Software Foundation; either version 2 of the
  11.    License, or (at your option) any later version.
  12.  
  13.    The GNU C Library is distributed in the hope that it will be useful,
  14.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.    Library General Public License for more details.
  17.  
  18.    You should have received a copy of the GNU Library General Public
  19.    License along with the GNU C Library; see the file COPYING.LIB.  If not,
  20.    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  21.    Boston, MA 02111-1307, USA.  */
  22.  
  23. #include "math.h"
  24.  
  25. #include "math_private.h"
  26.  
  27. int
  28. __signbit (double x)
  29. {
  30.   int32_t hx;
  31.  
  32.   GET_HIGH_WORD (hx, x);
  33.   return hx & 0x80000000;
  34. }
  35.