1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- float PI = 3.1415926535897932384;
- float abs(float f) {
- if(f < 0.0) {
- return -f;
- }
- return f;
- }
- void main() {
- test(abs(sin(0.0 * PI)));
- test(sin(0.5 * PI));
- test(abs(sin(1.0 * PI)));
- test(sin(1.5 * PI));
- test(abs(sin(2.0 * PI)));
-
- test(cos(0.0 * PI));
- test(abs(cos(0.5 * PI)));
- test(cos(1.0 * PI));
- test(abs(cos(1.5 * PI)));
- test(cos(2.0 * PI));
-
- test(abs(tan(0.0 * PI)));
- test(abs(tan(1.0 * PI)));
- test(abs(tan(2.0 * PI)));
-
- test(abs(asin(sin(0.0))));
- test(abs(asin(sin(0.5))));
- test(abs(asin(sin(1.0))));
- test(abs(asin(sin(1.5))));
-
- test(abs(acos(cos(0.0))));
- test(abs(acos(cos(0.5))));
- test(abs(acos(cos(1.0))));
- test(abs(acos(cos(1.5))));
-
- test(abs(atan(tan(0.0))));
- test(abs(atan(tan(0.5))));
- test(abs(atan(tan(1.0))));
- test(abs(atan(tan(1.5))));
-
- test(ln(256.0) / ln(2.0));
- test(log(256.0) / log(2.0));
- test(log(1000.0));
- test(sqrt(2.0));
- test(sqrt(10000.0));
-
- test(pow(2.0, 3.0));
- test(pow(2.0, 0.5));
- }
|