Search the web
Sign In
New User? Sign Up
forth200x
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
RfD: Separate FP Stack   Message List  
Reply | Forward Message #57 of 425 |
The HTML version of this proposal is at
<http://www.forth200x.org/fp-stack.html>.

Problem

Writing floating-point code such that it can run on a unified stack is
such a pain that most programmers don't do it.


Proposal

The floating-point stack is separate from the data stack.


Typical Use

\ from <126r7o1srr8aof0@...>
: square ( f - f') fdup f* ;
: pow ( n) ( f - f')
?dup 0= if fdrop 1e0 exit then
dup 1 = if drop exit then
2 /mod fdup square recurse fswap recurse f* ;


Experience

All ANS Forth systems that I know implement a separate floating-point
stack. Kforth implements a subset of ANS Forth subset and has a
unified FP stack.

All ANS Forth programs dealing with FP numbers that I know except code
written specifically for kforth just assumes a separate floating-point
stack.


Implementation and Tests

o Incomplete Implementation
<http://www.forth200x.org/reference-implementations/fp-stack.fs>;
the main missing piece is the (system-specific) text-interpreter
floating-point input.

o No tests yet

- anton



Sun Jun 4, 2006 6:31 pm

anton@...
Send Email Send Email

Forward
Message #57 of 425 |
Expand Messages Author Sort by Date

The HTML version of this proposal is at <http://www.forth200x.org/fp-stack.html>. Problem Writing floating-point code such that it can run on a unified stack...
Anton Ertl
anton@...
Send Email
Jun 4, 2006
6:33 pm

... No. Writing code that can run on unified and separate stacks is. ... Yes, make separate stacks the standard. No, just mark the unified stack usage as...
Stephen Pelc
sfprem
Offline Send Email
Jun 5, 2006
10:51 am

... I believe there is no difference, unless you also include dependencies on the number of cells an FP value takes on the data stack. ... Is this a request...
Anton Ertl
anton@...
Send Email
Jun 27, 2006
9:19 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help