diff --git a/Makefile b/Makefile index 8649f24f98a299024e1b50512b389bb0d39564c3..53d0772f749823d48e8db3ff51c1656d15b1a440 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ -SRCS := fx_3132.c +SRCS := test.c fx_3132.c OBJS := $(SRCS:.c=.o) CC := gcc CFLAGS := -c -Wall fx_3132 : $(OBJS) - $(CC) -o $@ $^ + $(CC) -o $@ $^ -lm clean : -rm $(OBJS) diff --git a/a.exe b/a.exe new file mode 100644 index 0000000000000000000000000000000000000000..79f45934e2dfa7ac250c443b2318107f766fbbf0 Binary files /dev/null and b/a.exe differ diff --git a/fx_3132.c b/fx_3132.c index 5eba89908c7a426f24424b9ca4de62137cc28b7b..4687baf122781eca9a800101af1fdb7fae38df5a 100644 --- a/fx_3132.c +++ b/fx_3132.c @@ -2,19 +2,19 @@ #include <math.h> #include "fx_s3132.h" -fx_3132 sine(fx_3132 a) { +fx_3132 sin2(fx_3132 a) { return double_to_fx(sin(fx_to_double(a))); }; -fx_3132 sqrt1(fx_3132 a) { +fx_3132 sqrt2(fx_3132 a) { return double_to_fx(sqrt(fx_to_double(a))); }; -fx_3132 power(fx_3132 a, fx_3132 b) { +fx_3132 power2(fx_3132 a, fx_3132 b) { return double_to_fx(pow(fx_to_double(a), fx_to_double(b))); }; -fx_3132 pi() { - return double_to_fx(fx_to_double(fx_PI)); +fx_3132 pi2() { + return double_to_fx(fx_to_double(PI)); }; -fx_3132 piReverse() { - return double_to_fx((fx_to_double(1 / fx_PI))); +fx_3132 piReverse2() { + return double_to_fx((fx_to_double(1 / PI))); }; diff --git a/fx_s3132.h b/fx_s3132.h index ac849a4f4c1366aa120c30608d75b410ce5ad392..b80f7c1e3358653449b3d2d88721efb838121ddd 100644 --- a/fx_s3132.h +++ b/fx_s3132.h @@ -18,3 +18,11 @@ #define fx_PI_Reverse() (double_to_fx((1/PI))) typedef long long fx_3132; + +fx_3132 sin2(fx_3132 a); +fx_3132 sqrt2(fx_3132 a); +fx_3132 power2(fx_3132 a, fx_3132 b); + +fx_3132 piReverse2(); +fx_3132 pi2(); + diff --git a/test.c b/test.c index 70e1d48b1c0ef8e27424bbbae35906b838787967..82f2cc564e42d08bb98300d7c4053fd0a6107632 100644 --- a/test.c +++ b/test.c @@ -1,4 +1,5 @@ #include <stdio.h> +#include <math.h> #include "fx_s3132.h" int main() {