On Wednesday 14 September 2005 18:47, Sergey Plis wrote:
> Hi!
>
> When I use a function from a library which returns a double precision
> float I get an error if before calling this function I place
> something on the floating point stack.
>
> Can this behavior be changed? I'd like to be able to use the f stack
> simultaneously.

I already do everything to allow that. The whole floating point stack is 
saved after constructing the C stack frame, and restored afterwards 
(assumed to be empty on return from the C function).

libm fmod df df (fp) fmod  ok
: test 1e 2e 3e 4e 5e 6e 2e 1.5e fmod fnip fnip fnip fnip fnip fnip f. ;  
ok
test 0.5  ok
: test 1e 2e 3e 4e 5e 6e 2e 1.5e fmod f>r f>r f. f. f. f. f. fr> f. fr> 
f. ;  TE
ST exists  ok
test 5. 4. 3. 2. 1. 6. 0.5  ok

Works as it should. If the function returns an int, use (int/fp).

If this wasn't the case, the whole 3D turtle would fail.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://www.jwdt.com/~paysan/

Attachment: pgpWrkTx0vyeW.pgp
Description: PGP signature

Reply via email to