rational.c: overhaul rational operators.

- define `MRB_TT_RATIONAL`
- change object structure (`struct RRational`)
- add memory management for `MRB_TT_RATIONAL`
- avoid operator overloading as much as possible
- implement division overloading in C
- as a result, performance improved a lot
This commit is contained in:
Yukihiro "Matz" Matsumoto
2021-03-18 16:27:35 +09:00
parent eb07030308
commit 08f9d5bab5
7 changed files with 292 additions and 107 deletions
+2
View File
@@ -129,6 +129,8 @@ enum mrb_vtype {
MRB_TT_FIBER,
MRB_TT_ISTRUCT,
MRB_TT_BREAK,
MRB_TT_COMPLEX,
MRB_TT_RATIONAL,
MRB_TT_MAXDEFINE
};