xo-reader2 stack: use NumericDispatch for *,/,+,- ops
This commit is contained in:
parent
43f120dd10
commit
9dca9a8c46
12 changed files with 167 additions and 17 deletions
|
|
@ -27,6 +27,20 @@ namespace xo {
|
|||
return DFloat::box<AGCObject>(rcx.allocator(), x->value() / y->value());
|
||||
}
|
||||
|
||||
obj<AGCObject>
|
||||
FloatIntegerOps::add(obj<ARuntimeContext> rcx,
|
||||
DFloat * x, DInteger * y)
|
||||
{
|
||||
return DFloat::box<AGCObject>(rcx.allocator(), x->value() + y->value());
|
||||
}
|
||||
|
||||
obj<AGCObject>
|
||||
FloatIntegerOps::subtract(obj<ARuntimeContext> rcx,
|
||||
DFloat * x, DInteger * y)
|
||||
{
|
||||
return DFloat::box<AGCObject>(rcx.allocator(), x->value() - y->value());
|
||||
}
|
||||
|
||||
// ----- Integer op Float -----
|
||||
|
||||
obj<AGCObject>
|
||||
|
|
@ -42,6 +56,21 @@ namespace xo {
|
|||
{
|
||||
return DFloat::box<AGCObject>(rcx.allocator(), x->value() / y->value());
|
||||
}
|
||||
|
||||
obj<AGCObject>
|
||||
IntegerFloatOps::add(obj<ARuntimeContext> rcx,
|
||||
DInteger * x, DFloat * y)
|
||||
{
|
||||
return DFloat::box<AGCObject>(rcx.allocator(), x->value() + y->value());
|
||||
}
|
||||
|
||||
obj<AGCObject>
|
||||
IntegerFloatOps::subtract(obj<ARuntimeContext> rcx,
|
||||
DInteger * x, DFloat * y)
|
||||
{
|
||||
return DFloat::box<AGCObject>(rcx.allocator(), x->value() - y->value());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue