home *** CD-ROM | disk | FTP | other *** search
- \ Balraj Sidhu Set: 14D4
- \ Comp 462 - Forth
- \ Date: April 7, 1990
- \ Problem 3.8
-
- \ Illustration of Number Bases and formatted display operators
-
- : binary ( -- ) 2 base ! ;
-
- : ntable ( dn -- )
- cr ." Unsigned" ." Signed" ." Unsigned"
- ." Signed" ." Unsigned" ." Signed"
- cr ." Decimal" ." Decimal" ." Binary"
- ." Binary" ." Hex " ." Hex "
- cr ." ----------------------------------------------"
- ." -------------------------------------------------------"
- 20 0 do
- cr
- decimal dup 10 u.r
- dup 10 .r
- binary dup 18 u.r
- dup 17 .r
- hex dup 10 u.r
- dup 10 .r
- 1 +
- loop
- drop decimal cr ;
-
-
-