diff --git a/AK/Math.h b/AK/Math.h index 982ae5c89a..f67c86c6e1 100644 --- a/AK/Math.h +++ b/AK/Math.h @@ -90,6 +90,8 @@ constexpr T fmod(T x, T y) } while (fpu_status & 0x400); return x; #else + // TODO: Add implementation for this function. + TODO(); return __builtin_fmod(x, y); #endif } @@ -109,6 +111,8 @@ constexpr T remainder(T x, T y) } while (fpu_status & 0x400); return x; #else + // TODO: Add implementation for this function. + TODO(); return __builtin_fmod(x, y); #endif } @@ -244,7 +248,9 @@ constexpr T sin(T angle) : "0"(angle)); return ret; #else - return __builtin_sin(angle); + // FIXME: This is a very naive implementation, and is only valid for small x. + // Probably a good idea to use a better algorithm in the future, such as a taylor approximation. + return angle; #endif } @@ -261,7 +267,9 @@ constexpr T cos(T angle) : "0"(angle)); return ret; #else - return __builtin_cos(angle); + // FIXME: This is a very naive implementation, and is only valid for small x. + // Probably a good idea to use a better algorithm in the future, such as a taylor approximation. + return 1 - ((angle * angle) / 2); #endif } @@ -298,7 +306,9 @@ constexpr T tan(T angle) return ret; #else - return __builtin_tan(angle); + // FIXME: This is a very naive implementation, and is only valid for small x. + // Probably a good idea to use a better algorithm in the future, such as a taylor approximation. + return angle; #endif } @@ -316,6 +326,8 @@ constexpr T atan(T value) : "0"(value)); return ret; #else + // TODO: Add implementation for this function. + TODO(); return __builtin_atan(value); #endif } @@ -371,6 +383,8 @@ constexpr T atan2(T y, T x) : "st(1)"); return ret; #else + // TODO: Add implementation for this function. + TODO(); return __builtin_atan2(y, x); #endif } @@ -404,6 +418,8 @@ constexpr T log(T x) : "0"(x)); return ret; #else + // TODO: Add implementation for this function. + TODO(); return __builtin_log(x); #endif } @@ -423,6 +439,8 @@ constexpr T log2(T x) : "0"(x)); return ret; #else + // TODO: Add implementation for this function. + TODO(); return __builtin_log2(x); #endif } @@ -442,6 +460,8 @@ constexpr T log10(T x) : "0"(x)); return ret; #else + // TODO: Add implementation for this function. + TODO(); return __builtin_log10(x); #endif } @@ -466,6 +486,8 @@ constexpr T exp(T exponent) : "0"(exponent)); return res; #else + // TODO: Add implementation for this function. + TODO(); return __builtin_exp(exponent); #endif } @@ -488,6 +510,8 @@ constexpr T exp2(T exponent) : "0"(exponent)); return res; #else + // TODO: Add implementation for this function. + TODO(); return __builtin_exp2(exponent); #endif }