Re: [ql-users] Not so Simple Arithmetic

2006-12-17 Thread Wolfgang Lenerz
On 16 Dec 2006 at 10:56, Marcel Kilgus wrote: Wolfgang Lenerz wrote: On an ordinary QL I can type f%=-32768/1 and find that f% now contains -32768. Well that must be a nice bug. unless I'm mistaken, 32768/1 = 32768 and 32768 just doesn't fit in an integer. Yes, but

Re: [ql-users] Not so Simple Arithmetic

2006-12-17 Thread Rich Mellor
On Sun, 17 Dec 2006 16:39:56 -, Wolfgang Lenerz [EMAIL PROTECTED] wrote: On 16 Dec 2006 at 10:56, Marcel Kilgus wrote: Wolfgang Lenerz wrote: On an ordinary QL I can type f%=-32768/1 and find that f% now contains -32768. Well that must be a nice bug. unless I'm

Re: [ql-users] Not so Simple Arithmetic

2006-12-17 Thread P Witte
Marcel Kilgus writes: Still it's a bug and I'll try to investigate when I find the time. But n = -32768/1: n% = n throws an overflow error n = -32768: n% = n is ok Doing a PRINT FLOAT$(-32768/1) gives $0810 C000 while PRINT FLOAT$(-32768 DIV 1) gives $080F 8000 Its not

Re: [ql-users] Not so Simple Arithmetic

2006-12-17 Thread Laurence W Reeves
Rich Mellor wrote: On Sun, 17 Dec 2006 16:39:56 -, Wolfgang Lenerz [EMAIL PROTECTED] wrote: On 16 Dec 2006 at 10:56, Marcel Kilgus wrote: Wolfgang Lenerz wrote: On an ordinary QL I can type f%=-32768/1 and find that f% now contains -32768. Well that

Re: [ql-users] Not so Simple Arithmetic

2006-12-17 Thread Laurence W Reeves
P Witte wrote: Marcel Kilgus writes: Still it's a bug and I'll try to investigate when I find the time. But n = -32768/1: n% = n throws an overflow error n = -32768: n% = n is ok Doing a PRINT FLOAT$(-32768/1) gives $0810 C000 You've detected the cause of

Re: [ql-users] Not so Simple Arithmetic

2006-12-17 Thread P Witte
Laurence W Reeves writes: n=-32768/1:n2=n*n:PRINT n2? I'd hazard a guess that one might get something like $0821 2000 . Actually $081F 4000 To a degree, calculations on the stack /may/ normalise values, but there's no guarantee. Also, it will be no surprise that one of

Re: [ql-users] Not so Simple Arithmetic

2006-12-17 Thread Marcel Kilgus
Laurence W Reeves wrote: PRINT FLOAT$(-32768/1) gives $0810 C000 You've detected the cause of the bug! SMSQ/E has allowed a unnormalised value to get on the stack. True. I found the following line in the code: [...] cmp.l #$c00,d1 ; funny value? [...] So there

Re: [ql-users] Not so Simple Arithmetic

2006-12-17 Thread Laurence W Reeves
Marcel Kilgus wrote: Laurence W Reeves wrote: PRINT FLOAT$(-32768/1) gives $0810 C000 You've detected the cause of the bug! SMSQ/E has allowed a unnormalised value to get on the stack. True. I found the following line in the code: [...] cmp.l #$c00,d1

Re: [ql-users] Not so Simple Arithmetic

2006-12-16 Thread Wolfgang Lenerz
On 15 Dec 2006 at 15:57, George Gwilt wrote: On an ordinary QL I can type f%=-32768/1 and find that f% now contains -32768. Well that must be a nice bug. unless I'm mistaken, 32768/1 = 32768 and 32768 just doesn't fit in an integer. Try this on the current versions of SMSQE (on Q60 or

Re: [ql-users] Not so Simple Arithmetic

2006-12-16 Thread Marcel Kilgus
Wolfgang Lenerz wrote: On an ordinary QL I can type f%=-32768/1 and find that f% now contains -32768. Well that must be a nice bug. unless I'm mistaken, 32768/1 = 32768 and 32768 just doesn't fit in an integer. Yes, but -32768 does. Notice the minus ;-) Marcel

Re: [ql-users] Not so Simple Arithmetic

2006-12-16 Thread P Witte
Marcel Kilgus writes: Wolfgang Lenerz wrote: On an ordinary QL I can type f%=-32768/1 and find that f% now contains -32768. Well that must be a nice bug. unless I'm mistaken, 32768/1 = 32768 and 32768 just doesn't fit in an integer. Yes, but -32768 does. Notice the minus ;-) Ah,

Re: [ql-users] Not so Simple Arithmetic

2006-12-16 Thread Dilwyn Jones
Wolfgang Lenerz wrote: On an ordinary QL I can type f%=-32768/1 and find that f% now contains -32768. Well that must be a nice bug. unless I'm mistaken, 32768/1 = 32768 and 32768 just doesn't fit in an integer. Yes, but -32768 does. Notice the minus ;-) Marcel As an interesting

Re: [ql-users] Not so Simple Arithmetic

2006-12-16 Thread Laurence W Reeves
P Witte wrote: Marcel Kilgus writes: Wolfgang Lenerz wrote: On an ordinary QL I can type f%=-32768/1 and find that f% now contains -32768. Well that must be a nice bug. unless I'm mistaken, 32768/1 = 32768 and 32768 just doesn't fit in an integer. Yes,

Re: [ql-users] Not so Simple Arithmetic

2006-12-16 Thread George Gwilt
On 16 Dec 2006, at 17:01, Laurence W Reeves wrote: P Witte wrote: Marcel Kilgus writes: Wolfgang Lenerz wrote: On an ordinary QL I can type f%=-32768/1 and find that f% now contains -32768. Well that must be a nice bug. unless I'm mistaken, 32768/1 = 32768 and 32768 just

Re: [ql-users] Not so Simple Arithmetic

2006-12-16 Thread P Witte
Laurence W Reeves writes: P Witte wrote: Marcel Kilgus writes: Wolfgang Lenerz wrote: On 15 Dec 2006 at 15:57, George Gwilt wrote: On an ordinary QL I can type f%=-32768/1 and find that f% now contains -32768. Well that must be a nice bug. unless I'm mistaken, 32768/1 = 32768 and

Re: [ql-users] Not so Simple Arithmetic

2006-12-16 Thread Marcel Kilgus
Laurence W Reeves wrote: This strikes me as a *very* serious bug. I don't quite think so. It's easily detectable, i.e. doesn't give a wrong result that could go unnoticed but is a hard error. Despite this fact it's been in there for probably well over a decade, so in the end it can't have been