Permalink
Browse files

[forth] fix problem with subtraction / negative numbers

This patch was provided by Github user: thecodewitch
who has a blog here: http://createuniverses.blogspot.com/

A link describing the problem and a Wikireader Forth simulator
can be found here:

  http://createuniverses.blogspot.com/2011/03/wikireader-forth-simulator.html

Signed-off-by: Christopher Hall <hsw@openmoko.com>
  • Loading branch information...
1 parent d8734dc commit d1b5b6e635c2fe05501a52368a239ab50431cf31 thecodewitch committed with hxw Mar 21, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 samo-lib/forth/programs/calc.4th
@@ -137,6 +137,8 @@ v-max 1+ constant v-overflow
else
= if
total-frac @ v-frac @ <
+ else
+ false
then
then
if
@@ -170,6 +172,8 @@ v-max 1+ constant v-overflow
else
= if
mem-frac @ total-frac @ <
+ else
+ false
then
then
if

0 comments on commit d1b5b6e

Please sign in to comment.