![]() |
||
| Home | SwiftForth Archive | SwiftX Archive | |

To round a number up to the next power of two if it isn't already a
power of two; From "Hacker's Delight", page 46:
: ROUND-UP ( n -- m )
1-
DUP 1 RSHIFT OR
DUP 2 RSHIFT OR
DUP 4 RSHIFT OR
DUP 8 RSHIFT OR
DUP 16 RSHIFT OR
1+ ;
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and
bug reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Mon Jun 09 2008 - 11:44:21 PDT
This archive was generated by hypermail 2.2.0 : Tue Dec 02 2008 - 03:04:44 PST