forked from aanon4/BlueBasic
-
Notifications
You must be signed in to change notification settings - Fork 9
Math pow()
kscheff edited this page Oct 24, 2017
·
1 revision
POW(a,b)
The POW(A,B) function rises A to the power of B. The two parameters A and B are expressed in fixed point. The upper 16 bits are the integer part, the lower 16 bits are fractional part. The result is expressed in same fixed point format.
// calculate the square root of 5.25
10 A = 344064 // 5.25 * 65536
20 B = 32768 // 0.5 * 65536
30 C = POW(A,B)
40 PRINT C>>16,".",(C & 0xFFF)*1000/65536
RUN
2.291
OK