Skip to content
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

Fix compiler div-by-0 error when it encountered 1.0/0.0 #4

Merged
merged 1 commit into from
May 29, 2016
Merged

Fix compiler div-by-0 error when it encountered 1.0/0.0 #4

merged 1 commit into from
May 29, 2016

Conversation

irwand
Copy link

@irwand irwand commented Apr 22, 2016

Tricked the compiler to use volatile local variable zero instead, so it does not know for sure whether or not it's going to be zero.

Sorry, I have my editor to remove all trailing whitespaces automatically, so it has those fixed too.

with division by 0.
Tricked the compiler to use volatile local variable zero instead, so it
does not know for sure whether or not it's going to be zero.
@irwand
Copy link
Author

irwand commented May 26, 2016

Then how does test the NaN case? The division by 0 was specifically done to test handling NaN case.

@DLonng
Copy link

DLonng commented May 26, 2016

Sorry, That need to think..., but the "1.0/0.0" is incorrect when compiler it.

@irwand
Copy link
Author

irwand commented May 26, 2016

that's why I used a volatile variable zero to trick the compiler to do it anyway. My patch compiles

@DLonng
Copy link

DLonng commented May 27, 2016

ok

@DaveGamble DaveGamble merged commit 4488c2b into DaveGamble:master May 29, 2016
@DaveGamble
Copy link
Owner

Nice patch. Thanks! :)

@irwand
Copy link
Author

irwand commented May 29, 2016

Thanks Dave!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants