summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2012-08-15 05:08:20 -0700
committerYukihiro "Matz" Matsumoto <[email protected]>2012-08-15 05:08:20 -0700
commit23e88dba6e9cfaded527f477341e7a7fe50e6795 (patch)
tree761ea7ca613d3a19ec9b5c488a0f5c0f1ca71f85 /include
parent2900b01a3dfe8cbc6fe8e96446d8a1c138379462 (diff)
parentfe9939f74e37b6b85f607289850263bcd773be91 (diff)
downloadmruby-23e88dba6e9cfaded527f477341e7a7fe50e6795.tar.gz
mruby-23e88dba6e9cfaded527f477341e7a7fe50e6795.zip
Merge pull request #427 from Constellation/canonicalize-nan-value
Canonicalize NaN value in NaN boxing environment
Diffstat (limited to 'include')
-rw-r--r--include/mruby/value.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/mruby/value.h b/include/mruby/value.h
index adc6b6d44..6cbe95509 100644
--- a/include/mruby/value.h
+++ b/include/mruby/value.h
@@ -134,7 +134,12 @@ mrb_float_value(mrb_float f)
{
mrb_value v;
- v.f = f;
+ if (f != f) {
+ v.ttt = 0x7ff80000;
+ v.value.i = 0;
+ } else {
+ v.f = f;
+ }
return v;
}
#endif /* MRB_NAN_BOXING */