From 8ecb5866d0a9d2bfb208492936d70804f31b6fcd Mon Sep 17 00:00:00 2001 From: Akira Kuroda Date: Sat, 22 Mar 2014 02:24:49 -0700 Subject: [PATCH] add explanation for divizion by zero behavior --- Scripting-faq.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Scripting-faq.md b/Scripting-faq.md index ca7cf9b..1aecac0 100644 --- a/Scripting-faq.md +++ b/Scripting-faq.md @@ -21,4 +21,16 @@ line 1: syntax error, unexpected tGVAR Aliasing global variables using alias statement is out of ISO scope. it's mruby limitation. -See also [mruby/issues#1154](https://github.com/mruby/mruby/issues/1154). \ No newline at end of file +See also [mruby/issues#1154](https://github.com/mruby/mruby/issues/1154). + +## Division by zero does not raise error. +``` +> 1 / 0 + => inf +> 1 % 0 + => NaN +> 0 / 0 + => NaN +``` +This behavior is an ISO incompatible feature. See +[mruby/pull#492](https://github.com/mruby/mruby/pull/492) and [mruby/pull#1907](https://github.com/mruby/mruby/pull/1907) . \ No newline at end of file