2
0
mirror of https://github.com/bebbo/amigaos-cross-toolchain.git synced 2025-12-08 22:38:24 +00:00
Files
2017-05-27 00:00:48 +02:00

15 lines
254 B
C
Executable File

typedef float SFtype __attribute__ ((mode (SF)));
SFtype
__powisf2 (SFtype x, int m)
{
unsigned int n = m < 0 ? -m : m;
SFtype y = n % 2 ? x : 1;
while (n >>= 1)
{
x = x * x;
if (n % 2)
y = y * x;
}
return m < 0 ? 1/y : y;
}