mirror of
https://frontier.innolan.net/github/amigaos-cross-toolchain6.git
synced 2024-10-19 10:29:55 +00:00
15 lines
254 B
C
Executable File
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;
|
|
}
|