Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not so much a bug, as slow!
#5
britlion Wrote:Okay. Fairly convinced there's a bug here.

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!)
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.
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
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)