abs MIA and 0 < strangeness?
Alex Holden <[email protected]> Tue, 23 Nov 2004 19:39:16 +0000
| Newsgroups | gmane.comp.lang.forth.picforth |
|---|---|
| Message-ID | <[email protected]> |
The manual says that Picforth defines abs, and priotasker.fs makes use of it, but it doesn't actually seem to exist in picforth.fs or any of the libraries. Also the manual shows an example of how to write abs, but either the example is wrong or Picforth's handling of the '0 <' construct is wrong (in essence the result of '0 <' is always true). The 0< word works as expected though. A working (but not highly optimised) abs is as follows: : abs dup 0< if negate then ; -- ------------ Alex Holden - http://www.linuxhacker.org ------------ If it doesn't work, you're not hitting it with a big enough hammer