diff options
Diffstat (limited to 'functions.c')
-rw-r--r-- | functions.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/functions.c b/functions.c index 870ee17..2e0bfa2 100644 --- a/functions.c +++ b/functions.c @@ -680,8 +680,12 @@ SCALAR_FUNCTION_2(fnTimes, 0, left->type, SCALAR_FUNCTION_2(fnDivide, 1, left->type, case AtypeFloat: - if(right->floatdata[i] == 0) - throwerror(nil, EDomain); + if(right->floatdata[i] == 0){ + if(currentsymtab->div) + res->floatdata[i] = 0; + else + throwerror(nil, EDomain); + } else res->floatdata[i] /= right->floatdata[i]; break; |