|
Saswata on 08/09/13 - 05:55:23
<DEFINT A-Z
CLS A$ = "f" A = ASC(A$) N = A ^ 4 - 600 * 23 PRINT N END> If I put DEFLNG instead of DEFINT, N returns a different value. Why?
Todd on 08/09/13 - 08:02:38
Reply to this message
DEFLNG defines "longs" while DEFINT defines "integers". Integers in QB64 are 2-bytes meaning that they can store the values between -32768 and 32767. Longs are 4-bytes and store -2147483648 to 2147483647.
Your expression "A ^ 4" computes to roughly 108243216, which causes an overflow if A is an integer. If it's a long, it will evaluate to its correct value. Hope this helps! |
|