On 03/04/2016 11:14 AM, jdd wrote:
Forth is integer only
Yes it used to be but we changed all that. American National Standards Institute FORTH can do floating point calculations, just like modern LisP can. It was decided to implement this using a separate stack from the native mode fixed arithmetic. http://www.triangledigital.com/man2020f/ch3ansfp.htm Why? https://groups.google.com/forum/#!topic/comp.lang.forth/QmqcJJE2bQk See also http://www.forth200x.org/documents/html/diff.html an d http://www.forth.org/fd/FD-V08N5.pdf I've implemented FORTH directly (i.e. not in C, C++ or java) on a variety of machines, PDP-11, Z-8000 (wonderful for keeping the top few elements of stack in the register bank, wonderful for using other registers as pointers to the various stacks), M68000, and also an 8-bit 8051 for an embedded application. I've tried gFORTH but get to wonder why one has to implement what amounts to sophisticated machine code in a HLL interpreter. gFORTH also has floating point https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/Floating-Point-Tuto... Yes, its there; yes its part of the current standard. No, I've never implemented it. I've never needed it. But then the applications I've written in FORTH have never needed it. To be honest, I've never even needed 16 bits of arithmetic. I can see that Leo's original application involving astronomy and telescopes would need floating point but apparently he did what many programmers did and used fixed point precision with long integers. BTDT. -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org