Created
August 29, 2010 19:53
-
-
Save evtuhovich/556622 to your computer and use it in GitHub Desktop.
This file contains 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
From 59c5b3824a16167ae975d382a8f4c293649757cd Mon Sep 17 00:00:00 2001 | |
From: Ivan Evtukhovich <evtuhovich@gmail.com> | |
Date: Sun, 29 Aug 2010 23:46:40 +0400 | |
Subject: [PATCH 2/2] Fix for Float#mod bug, issue #451 | |
--- | |
vm/builtin/float.cpp | 4 ++-- | |
1 files changed, 2 insertions(+), 2 deletions(-) | |
diff --git a/vm/builtin/float.cpp b/vm/builtin/float.cpp | |
index 5b63bcf..a94d56e 100644 | |
--- a/vm/builtin/float.cpp | |
+++ b/vm/builtin/float.cpp | |
@@ -104,8 +104,8 @@ namespace rubinius { | |
Float* Float::mod(STATE, Float* other) { | |
double res = fmod(this->val, other->val); | |
- if((other->val < 0.0 && this->val > 0.0) || | |
- (other->val > 0.0 && this->val < 0.0)) { | |
+ if((other->val < 0.0 && this->val > 0.0 && res != 0) || | |
+ (other->val > 0.0 && this->val < 0.0 && res != 0)) { | |
res += other->val; | |
} | |
return Float::create(state, res); | |
-- | |
1.7.0.4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment