summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-01-11 00:46:35 +0000
committerocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-01-11 00:46:35 +0000
commitff57fbf2a69dbd8af929e747d0f7262803b78b1d (patch)
tree5a76cb15abeed6de7b2607c4289d644c76891a80 /numeric.c
parent60e9c4e62ae0ae46671789c97decf7be7d2af7f7 (diff)
* numeric.c (Init_Numeric): turn off floating point exceptions
on bcc32. "1e300".to_f had crashed by overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/numeric.c b/numeric.c
index abf4cda397..71a6d10c20 100644
--- a/numeric.c
+++ b/numeric.c
@@ -2768,6 +2768,9 @@ Init_Numeric()
#elif defined(_UNICOSMP)
/* Turn off floating point exceptions for divide by zero, etc. */
_set_Creg(0, 0);
+#elif defined(__BORLANDC__)
+ /* Turn off floating point exceptions for overflow, etc. */
+ _control87(MCW_EM, MCW_EM);
#endif
id_coerce = rb_intern("coerce");
id_to_i = rb_intern("to_i");