xo-interpreter2 stack: streamline op== impl + utests

This commit is contained in:
Roland Conybeare 2026-02-19 09:03:02 -08:00
commit 243ad12869
12 changed files with 97 additions and 10 deletions

View file

@ -5,6 +5,7 @@
#include "FloatIntegerOps.hpp"
#include "float/INumeric_DFloat.hpp"
#include <xo/object2/Boolean.hpp>
namespace xo {
using xo::mm::AGCObject;
@ -41,6 +42,14 @@ namespace xo {
return DFloat::box<AGCObject>(rcx.allocator(), x->value() - y->value());
}
obj<AGCObject>
FloatIntegerOps::cmp_equal(obj<ARuntimeContext> rcx,
DFloat * x, DInteger * y)
{
return DBoolean::box<AGCObject>(rcx.allocator(),
x->value() == DFloat::value_type(y->value()));
}
// ----- Integer op Float -----
obj<AGCObject>
@ -71,6 +80,14 @@ namespace xo {
return DFloat::box<AGCObject>(rcx.allocator(), x->value() - y->value());
}
obj<AGCObject>
IntegerFloatOps::cmp_equal(obj<ARuntimeContext> rcx,
DInteger * x, DFloat * y)
{
return DFloat::box<AGCObject>(rcx.allocator(),
DFloat::value_type(x->value() == y->value()));
}
}
}