Forum
Long Division (*solved*) - Printable Version

+- Forum (https://www.boriel.com/forum)
+-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12)
+--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11)
+---- Forum: Bug Reports (https://www.boriel.com/forum/forumdisplay.php?fid=15)
+---- Thread: Long Division (*solved*) (/showthread.php?tid=187)



Long Division (*solved*) - britlion - 03-21-2010

Code:
CLS

dim bigNum as LONG
let bigNum=25000


print "bignum=";bigNum
PRINT
print "10*bigNum=";10*bigNum
PRINT
print "bigNum/10=";bigNum/10

The LONG division code seems borked. It always returns zero.


Re: Long Division - boriel - 03-21-2010

britlion Wrote:
Code:
CLS

dim bigNum as LONG
let bigNum=25000


print "bignum=";bigNum
PRINT
print "10*bigNum=";10*bigNum
PRINT
print "bigNum/10=";bigNum/10

The LONG division code seems borked. It always returns zero.
It was a bug, yes. LONG (not ULONG) division was failing for positive divisors. *Fixed*.
Download 1.2.5-r1513g: <!-- m --><a class="postlink" href="http://www.boriel.com/files/zxb/zxbasic-1.2.5r1514g.msi">http://www.boriel.com/files/zxb/zxbasic-1.2.5r1514g.msi</a><!-- m -->


Re: Long Division (*fixed*) - britlion - 03-21-2010

And I just noticed before I upgraded that mod was not working either - but since it's the same asm that produces it, that's not too surprising.

I can report that MOD works nicely on LONG again.