math_tests: pow test (#1842)

* math::nolibc: replaced code with word macros

* math_tests: pow test

Added test for pow and added more test points for the exp and log tests.
This commit is contained in:
Taylor W
2025-01-15 06:35:18 -06:00
committed by GitHub
parent 2f7d18bfb8
commit 660654f9e0
5 changed files with 104 additions and 45 deletions

View File

@@ -18,7 +18,7 @@ module std::math::nolibc @if(env::NO_LIBC || $feature(C3_MATH));
fn float _sinf(float x) @weak @extern("sinf") @nostrip
{
uint ix = bitcast(x, uint);
uint ix = x.word();
int sign = ix >> 31;
ix &= 0x7fffffff;
switch
@@ -87,8 +87,7 @@ fn float _sinf(float x) @weak @extern("sinf") @nostrip
fn double sin(double x) @extern("sin") @weak @nostrip
{
// High word of x.
uint ix = (uint)(bitcast(x, ulong) >> 32);
ix &= 0x7fffffff;
uint ix = x.high_word() & 0x7fffffff;
switch
{
// |x| ~< pi/4