Add f32 and f64 distinction

This commit is contained in:
Rerumu
2022-06-25 04:30:06 -04:00
parent 951ee169a2
commit 5b61f742f4
5 changed files with 160 additions and 89 deletions
+7 -3
View File
@@ -96,11 +96,11 @@ do
return (i64(u64(lhs) % u64(rhs)))
end
function neg.num(num)
function neg.f32(num)
return -num
end
function copysign.num(lhs, rhs)
function copysign.f32(lhs, rhs)
RE_INSTANCE.f64 = rhs
if RE_INSTANCE.b32 >= 0 then
@@ -110,7 +110,7 @@ do
end
end
function nearest.num(num)
function nearest.f32(num)
local result = round(num)
if math_abs(num) % 1 == 0.5 and temp_2 % 2 == 1 then
@@ -120,6 +120,10 @@ do
return result
end
neg.f64 = neg.f32
copysign.f64 = copysign.f32
nearest.f64 = nearest.f32
module.add = add
module.sub = sub
module.mul = mul