Mail Archives: djgpp-workers/2003/09/18/12:51:12
On Tue, 9 Sep 2003 Kbwms AT aol DOT com wrote:
> According to paragraph F.9.3.12 of ISO/IEC 9899:1999 (E),
>
> -- modfl(+-Infinity, iptr) returns +-0 and stores +-Infinity in the
> in the object pointed to by iptr
>
> modfl in libc.a:
> ---------------
> modfl(+Inf, &IntPart): FracPart = -NaN, IntPart = +Inf
> modfl(-Inf, &IntPart): FracPart = -NaN, IntPart = -Inf
Is it important to return -0 for -Inf? If not, then the following patch
should be sufficient:
Index: modfl.S
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/ansi/math/modfl.S,v
retrieving revision 1.1
diff -c -r1.1 modfl.S
*** modfl.S 25 Nov 1994 19:59:40 -0000 1.1
--- modfl.S 18 Sep 2003 09:55:44 -0000
***************
*** 17,22 ****
--- 17,33 ----
fldcw -2(%ebp)
fld %st(0)
fstpt (%eax)
+ fucom %st(1)
+ fnstsw -2(%ebp)
+ movw -2(%ebp),%dx
+ andb $0x40,%dh
+ jz 0f
+ fstp %st(0)
+ fstp %st(0)
+ fldz
+ jmp 1f
+ 0:
fsubrp %st,%st(1)
+ 1:
leave
ret
--
Esa Peuha
student of mathematics at the University of Helsinki
http://www.helsinki.fi/~peuha/
- Raw text -