mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-16 17:27:33 +02:00
Issue #210 - Prevent divide-by-zero error
This commit is contained in:
parent
c925385305
commit
f106a1f0a2
2 changed files with 11 additions and 0 deletions
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -1,5 +1,15 @@
|
|||
# Changelog
|
||||
|
||||
## Next Release - TBD
|
||||
|
||||
Features
|
||||
|
||||
- Added SRFI 143 - Fixnums.
|
||||
|
||||
Bug Fixes
|
||||
|
||||
- Prevent `remainder` from crashing the runtime due to divide by zero.
|
||||
|
||||
## 0.5.4 - August 3, 2017
|
||||
|
||||
Features
|
||||
|
|
|
@ -3367,6 +3367,7 @@ void Cyc_remainder(void *data, object cont, object num1, object num2)
|
|||
j = ((double_type *)num2)->value;
|
||||
}
|
||||
}
|
||||
if (j == 0) { Cyc_rt_raise_msg(data, "Divide by zero"); }
|
||||
result = obj_int2obj(i % j);
|
||||
return_closcall1(data, cont, result);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue