SCOUG-Programming Mailing List Archives
Return to [ 14 |
February |
2005 ]
<< Previous Message <<
>> Next Message >>
Content Type: text/plain
Peter Skye wrote:
> Gregory W. Smith wrote:
> >
> > You can . . . do this arithmetic EXACTLY with a positional numbering
> > system only as long as you have the correct base for the number system.
>
> Beautifully said. Thank you, Greg.
>
> - Peter
The fun hack was doing the Base-21 arithmetic. I did it with the boot
loader. OS X and FreeBSD use FORTH for the boot loader. You can use
whatever you want to have results displayed in whatever base you want.
: BASE3 3 BASE ! ; \ Switch to base-3 for input & output display
: BASE7 7 BASE ! ; \ Switch to base-7
: BASE10 10 BASE ! ; \ Back to decimal
: BASE21 21 BASE ! ;
Just be sure to make the colon definitions before you change bases.
You will get a surprise if you don't. Guess what, after you change
the base, the command
10 BASE !
does not put you back in decimal for your input and output display.
--
Gregory W. Smith (WD9GAY) gsmith@well.com
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-programming".
For problems, contact the list owner at
"postmaster@scoug.com".
=====================================================
<< Previous Message <<
>> Next Message >>
Return to [ 14 |
February |
2005 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.
|