11-11-2012, 11:35 PM
britlion Wrote:Okay. Fairly convinced there's a bug here.This is also ok. It happens that when the number changes from 6 digits to 4, what you see is the remaining digits from previous calculation.
zxb version 1.3.0-S928
Here's an expanded program in full - was looking at perhaps faster squaring?
Anyway, the retruned value is weird.
A statement of: print x;" ";fastSquares(ABS x);" = ";CAST(uLong, x)*x ;"[]"
Comes back lines like
-61 3721 = 3721 [] 0 []
There's no way it should print anything after it's confirmed the function does the same thing as the X*X calculation. No [] twice. (I put that on the end because it was adding a bunch of zeroes instead without it!)
Ensure that line erases previous results by adding extra spaces after "[]", this way:
Code:
print x;" ";fastSquares(ABS x);" = ";CAST(uLong, x)*x ;"[] " ' <= 4 spaces is enough