My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 142: a %= b causes the program to crash if b = 0
1 person starred this issue and may be notified of changes. Back to list
Status:  WontFix
Owner:  ----
Closed:  Feb 2012


 
Reported by marwe...@gmail.com, Sep 30, 2011
What steps will reproduce the problem?
1. var a = 10;
2.a %= 0; #Program crashes
3.

What is the expected output? What do you see instead?
Expected output would be zero.
The application crashes

What version of the product are you using? On what operating system?
2.0.8 from haxelib, haven't had time to test the svn version yet.

Please provide any additional information below.
a = a % 0;
Works as expected.

Feb 8, 2012
Project Member #1 gameh...@gmail.com
Hi,
I think modulo 0 is undefined - remainder after division by 0 is a divide by zero error.
I think it is up to the user code to guard against this.  However, if you can point me to some doco that says otherwise, I will change it.
Status: WontFix
Feb 8, 2012
#2 marwe...@gmail.com
You are right of course I forgot I wrote that and looking back I should have realized that it crashes because of divide by zero. I guess I only saw that one way made it crash and the other didn't and assumed that there was a bug somewhere.

Powered by Google Project Hosting