-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't allow dividing by 0 #29
Comments
I am on this; will PR soon. How should we handle the |
yeah, I think I'm comfy having them give the same error. Sound ok to you? |
Yes I think that makes sense! I'll PR later tonight. |
Hey @hmaurer, I see you have a branch open for this and a commit - did you forget to put up a PR or did you want to work on it a bit more first? |
@hmaurer ? |
@evykassirer Sorry for the delay; I have opened a PR edit: will do in 5min, I first need to merge master and there are conflicts :( |
no problem at all, just wanted to make sure it wasn't forgotten about ^_^ |
This is interesting, I wonder if there should be a NodeStatus for errors like this in general that we check, not just divide by zero. |
@aelnaiem I was thinking about that too! In the PR, I talked about:
what do you think? |
Yea I think that's a good idea! |
UPDATE: now related to #129 -- let's use it as the first error that we implement with the new error structure I removed the small label, since this is more complicated now |
This is blocked on our error infrastruction #129 -- let's use it as the first error that we implement with the new error structure
We don't check for this, which means division by 0 gives weird results.
This functionality would probably go in simplifyBasics, or in a separate DFS before that - since checking for dividing by zero is important before anything else is attempted.
I think (though feel free to approach this a different way) that dividing by zero would look like this:
NodeStatus.hasChanged
object wherenewNode
is actually the same asoldNode
and thechangeType
isDIVIDE_BY_ZERO
simplifyExpression
, in the functionstepThrough
, after each call tostep
, check if the changeType wasDIVIDE_BY_ZERO
-- if so, break out of the while loopThe text was updated successfully, but these errors were encountered: