[154] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next next in chain last in chain last

Re: hrm, and mod by zero

daemon@ATHENA.MIT.EDU (Tue Mar 22 13:30:38 1994 )

From: zachary@io.com (Zachary )
To: BRANDON@cc.usu.edu
Cc: coldstuff@MIT.EDU, zachary@io.com
In-Reply-To: Your message of Mon, 14 Mar 94 01:21:52.
Date: Tue, 22 Mar 94 12:26:00 CST

>> I guess the mod by zero isn't fixed yet, either..
>> (thought it was fixed in .10)

I'm only a minor C hacker, but even I can fix this one. uhm... 
arithop.c, line 100 says:
 } else if (d2->type == 0) { 

when it should say:

 } else if (d2->u.val == 0) {

to test for the 'are we dividing by zero' case.  
I've also found the source of the random(0) error, but am not sure of the
behaviour desired if someone DOES do a random(0)... 0? error? 1? other?