Created
October 3, 2010 13:01
-
-
Save miyamuko/608561 to your computer and use it in GitHub Desktop.
xyzzy の single-float-epsilon を適当に直してみる
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/init.cc b/src/init.cc | |
| index e596287..268e6ed 100644 | |
| --- a/src/init.cc | |
| +++ b/src/init.cc | |
| @@ -296,10 +296,10 @@ init_math_symbols () | |
| make_single_float (FLT_MIN); | |
| xsymbol_value (Qleast_negative_normalized_single_float) = | |
| make_single_float (-FLT_MIN); | |
| - for (fl = 1.0F, fe = 1.1F; 1.0F + fl != 1.0F && fe > fl; fe = fl, fl /= 2.0F) | |
| + for (fl = 1.0F, fe = 1.1F; (float)(1.0F + fl) != 1.0F && fe > fl; fe = fl, fl /= 2.0F) | |
| ; | |
| xsymbol_value (Qsingle_float_epsilon) = make_single_float (fe); | |
| - for (fl = 1.0F, fe = 1.1F; 1.0F - fl != 1.0F && fe > fl; fe = fl, fl /= 2.0F) | |
| + for (fl = 1.0F, fe = 1.1F; (float)(1.0F - fl) != 1.0F && fe > fl; fe = fl, fl /= 2.0F) | |
| ; | |
| xsymbol_value (Qsingle_float_negative_epsilon) = make_single_float (fe); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment