/** @file FloatOps.cp * * @author Roland Conybeare, Feb 2206 **/ #include "FloatOps.hpp" #include "float/INumeric_DFloat.hpp" #include namespace xo { using xo::mm::AGCObject; namespace scm { obj FloatOps::multiply(obj rcx, DFloat * x, DFloat * y) { return DFloat::box(rcx.allocator(), x->value() * y->value()); } obj FloatOps::divide(obj rcx, DFloat * x, DFloat * y) { return DFloat::box(rcx.allocator(), x->value() / y->value()); } obj FloatOps::add(obj rcx, DFloat * x, DFloat * y) { return DFloat::box(rcx.allocator(), x->value() + y->value()); } obj FloatOps::subtract(obj rcx, DFloat * x, DFloat * y) { return DFloat::box(rcx.allocator(), x->value() - y->value()); } obj FloatOps::cmp_equal(obj rcx, DFloat * x, DFloat * y) { return DBoolean::box(rcx.allocator(), x->value() == y->value()); } obj FloatOps::cmp_notequal(obj rcx, DFloat * x, DFloat * y) { return DBoolean::box(rcx.allocator(), x->value() != y->value()); } obj FloatOps::cmp_less(obj rcx, DFloat * x, DFloat * y) { return DBoolean::box(rcx.allocator(), x->value() < y->value()); } obj FloatOps::cmp_lessequal(obj rcx, DFloat * x, DFloat * y) { return DBoolean::box(rcx.allocator(), x->value() <= y->value()); } obj FloatOps::cmp_greater(obj rcx, DFloat * x, DFloat * y) { return DBoolean::box(rcx.allocator(), x->value() > y->value()); } obj FloatOps::cmp_greatequal(obj rcx, DFloat * x, DFloat * y) { return DBoolean::box(rcx.allocator(), x->value() >= y->value()); } } } /* end FloatOps.cpp */