|
Szabolcs Nagy |
7d8d55 |
#include <tgmath.h>
|
|
Szabolcs Nagy |
7d8d55 |
#include "test.h"
|
|
Szabolcs Nagy |
7d8d55 |
|
|
Szabolcs Nagy |
7d8d55 |
int main(void)
|
|
Szabolcs Nagy |
7d8d55 |
{
|
|
Szabolcs Nagy |
7d8d55 |
long i;
|
|
Szabolcs Nagy |
7d8d55 |
|
|
Szabolcs Nagy |
7d8d55 |
i = lrint(123456789.1f) & 0x7fffffff;
|
|
Szabolcs Nagy |
7d8d55 |
if (i != 123456792)
|
|
Szabolcs Nagy |
cfa23c |
t_error("lrint(123456789.1f)&0x7fffffff want 123456792 got %ld\n", i);
|
|
Szabolcs Nagy |
7d8d55 |
i = lrint(123456789.1) & 0x7fffffff;
|
|
Szabolcs Nagy |
7d8d55 |
if (i != 123456789)
|
|
Szabolcs Nagy |
cfa23c |
t_error("lrint(123456789.1)&0x7fffffff want 123456789 got %ld\n", i);
|
|
Szabolcs Nagy |
7d8d55 |
|
|
Szabolcs Nagy |
7d8d55 |
if (sqrt(2.0f) != 1.41421353816986083984375)
|
|
Szabolcs Nagy |
cfa23c |
t_error("sqrt(2.0f) want 0x1.6a09e6p+0 got %a\n", sqrt(2.0f));
|
|
Szabolcs Nagy |
7d8d55 |
if (sqrt(2.0) != 1.414213562373095145474621858738828450441360)
|
|
Szabolcs Nagy |
cfa23c |
t_error("sqrt(2.0) want 0x1.6a09e667f3bcdp+0 got %a\n", sqrt(2.0));
|
|
Szabolcs Nagy |
7d8d55 |
if (sqrt(2) != 1.414213562373095145474621858738828450441360)
|
|
Szabolcs Nagy |
cfa23c |
t_error("sqrt(2) want 0x1.6a09e667f3bcdp+0 got %a\n", sqrt(2.0));
|
|
Szabolcs Nagy |
7d8d55 |
|
|
Szabolcs Nagy |
7d8d55 |
if (sizeof pow(sqrt(8),0.5f) != sizeof(double))
|
|
Szabolcs Nagy |
cfa23c |
t_error("sizeof pow(sqrt(8),0.5f) want %d got %d\n", (int)sizeof(double), (int)sizeof pow(sqrt(8),0.5f));
|
|
Szabolcs Nagy |
7d8d55 |
if (sizeof pow(2.0,0.5) != sizeof(double))
|
|
Szabolcs Nagy |
cfa23c |
t_error("sizeof pow(2.0,0.5) want %d got %d\n", (int)sizeof(double), (int)sizeof pow(2.0,0.5));
|
|
Szabolcs Nagy |
7d8d55 |
if (sizeof pow(2.0f,0.5f) != sizeof(float))
|
|
Szabolcs Nagy |
cfa23c |
t_error("sizeof pow(2.0f,0.5f) want %d got %d\n", (int)sizeof(float), (int)sizeof pow(2.0f,0.5f));
|
|
Szabolcs Nagy |
7d8d55 |
if (sizeof pow(2.0,0.5+0*I) != sizeof(double complex))
|
|
Szabolcs Nagy |
cfa23c |
t_error("sizeof pow(2.0,0.5+0*I) want %d got %d\n", (int)sizeof(double complex), (int)sizeof pow(2.0,0.5+0*I));
|
|
Szabolcs Nagy |
7d8d55 |
|
|
Szabolcs Nagy |
7d8d55 |
if (pow(2.0,0.5) != 1.414213562373095145474621858738828450441360)
|
|
Szabolcs Nagy |
cfa23c |
t_error("pow(2.0,0.5) want 0x1.6a09e667f3bcdp+0 got %a\n", pow(2.0,0.5));
|
|
Szabolcs Nagy |
7d8d55 |
if (pow(2,0.5) != 1.414213562373095145474621858738828450441360)
|
|
Szabolcs Nagy |
cfa23c |
t_error("pow(2,0.5) want 0x1.6a09e667f3bcdp+0 got %a\n", pow(2,0.5));
|
|
Szabolcs Nagy |
7d8d55 |
if (pow(2,0.5f) != 1.414213562373095145474621858738828450441360)
|
|
Szabolcs Nagy |
cfa23c |
t_error("pow(2,0.5f) want 0x1.6a09e667f3bcdp+0 got %a\n", pow(2,0.5f));
|
|
Szabolcs Nagy |
7d8d55 |
|
|
Szabolcs Nagy |
cfa23c |
return t_status;
|
|
Szabolcs Nagy |
7d8d55 |
}
|