home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / MATH / LDEXP.S < prev    next >
Encoding:
Text File  |  1993-01-02  |  587 b   |  30 lines

  1. / ldexp.s (emx+gcc) -- Copyright (c) 1991-1993 by Eberhard Mattes
  2.  
  3. #include <libm.h>
  4.  
  5.         .globl  _ldexp
  6.  
  7.         .text
  8.  
  9.         .align  2, 0x90
  10.  
  11. / double ldexp (double x, int exp)
  12.  
  13. #define x        4(%esp)
  14. #define exp     12(%esp)
  15.  
  16. _ldexp:
  17.         fildl   exp                     / exp
  18.         fldl    x                       / x
  19.         fscale
  20.         fstp    %st(1)
  21.         fstpl   x                       / convert to double
  22.         fldl    x
  23.         _xam
  24.         j_inf   1f
  25.         ret
  26.  
  27.         .align  2, 0x90
  28. 1:      SETERRNO($ERANGE)
  29.         ret
  30.