summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorConstellation <[email protected]>2012-08-15 18:41:07 +0900
committerConstellation <[email protected]>2012-08-15 21:02:46 +0900
commitfe9939f74e37b6b85f607289850263bcd773be91 (patch)
tree761ea7ca613d3a19ec9b5c488a0f5c0f1ca71f85 /include
parent2900b01a3dfe8cbc6fe8e96446d8a1c138379462 (diff)
downloadmruby-fe9939f74e37b6b85f607289850263bcd773be91.tar.gz
mruby-fe9939f74e37b6b85f607289850263bcd773be91.zip
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 */