From 97ceb12d6ec653a1bc409edbad4d9474f3aadc6c Mon Sep 17 00:00:00 2001 From: koniifer Date: Sun, 10 Nov 2024 20:07:03 +0000 Subject: [PATCH] double skill issue --- sysdata/libraries/stn/src/math.hb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysdata/libraries/stn/src/math.hb b/sysdata/libraries/stn/src/math.hb index 5b791b4e..1365d0da 100644 --- a/sysdata/libraries/stn/src/math.hb +++ b/sysdata/libraries/stn/src/math.hb @@ -40,7 +40,7 @@ $TABLE_SIZE := @as(i32, 256) sin := fn(theta: f32): f32 { si := @fti(theta * 0.5 * @itf(TABLE_SIZE) / PI) - d := theta - @itf(si) * 2.0 * PI / @itf(TABLE_SIZE) + d := theta - @floatcast(@itf(si)) * 2.0 * PI / @floatcast(@itf(TABLE_SIZE)) ci := si + TABLE_SIZE / 4 & TABLE_SIZE - 1 si &= TABLE_SIZE - 1 return SIN_TABLE[@bitcast(si)] + (SIN_TABLE[@bitcast(ci)] - 0.5 * SIN_TABLE[@bitcast(si)] * d) * d @@ -48,7 +48,7 @@ sin := fn(theta: f32): f32 { cos := fn(theta: f32): f32 { ci := @fti(theta * 0.5 * @itf(TABLE_SIZE) / PI) - d := theta - @itf(ci) * 2.0 * PI / @itf(TABLE_SIZE) + d := theta - @floatcast(@itf(ci)) * 2.0 * PI / @floatcast(@itf(TABLE_SIZE)) si := ci + TABLE_SIZE / 4 & TABLE_SIZE - 1 ci &= TABLE_SIZE - 1 return SIN_TABLE[@bitcast(si)] - (SIN_TABLE[@bitcast(ci)] + 0.5 * SIN_TABLE[@bitcast(si)] * d) * d