Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions compiler+runtime/src/cpp/jank/runtime/core/math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1795,15 +1795,15 @@ namespace jank::runtime

obj::big_integer_ref to_big_integer(object_ref const o)
{
return visit_number_like(
return visit_object(
[&](auto const typed_o) -> obj::big_integer_ref {
using T = typename decltype(typed_o)::value_type;

if constexpr(std::same_as<T, obj::big_integer>)
{
return typed_o;
}
else if constexpr(std::same_as<T, obj::integer>)
else if constexpr(std::same_as<T, obj::integer> || std::same_as<T, obj::persistent_string>)
{
return make_box<obj::big_integer>(typed_o->data);
}
Expand All @@ -1828,7 +1828,7 @@ namespace jank::runtime

obj::big_decimal_ref to_big_decimal(object_ref const o)
{
return visit_number_like(
return visit_object(
[&](auto const typed_o) -> obj::big_decimal_ref {
using T = typename decltype(typed_o)::value_type;

Expand All @@ -1837,7 +1837,7 @@ namespace jank::runtime
return make_box<obj::big_decimal>(typed_o->to_real());
}
else if constexpr(std::same_as<T, obj::big_integer> || std::same_as<T, obj::real>
|| std::same_as<T, obj::ratio>)
|| std::same_as<T, obj::ratio> || std::same_as<T, obj::persistent_string>)
{
return make_box<obj::big_decimal>(typed_o->data);
}
Expand Down
Loading