From 6115da1a2aa3820bc7b1db8cfe044518626ca581 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 14 May 2015 19:06:00 +0000 Subject: [PATCH] [CRT] Add simple C implementations for _chgsignf, _copysignf, _hypotf, asinf, atan2f, atanf, coshf, expf, log10f, modff, sinhf, tanf, tanhf svn path=/trunk/; revision=67717 --- reactos/lib/sdk/crt/math/_chgsignf.c | 10 ++++++++++ reactos/lib/sdk/crt/math/_copysignf.c | 12 ++++++++++++ reactos/lib/sdk/crt/math/_hypotf.c | 12 ++++++++++++ reactos/lib/sdk/crt/math/asinf.c | 11 +++++++++++ reactos/lib/sdk/crt/math/atan2f.c | 12 ++++++++++++ reactos/lib/sdk/crt/math/atanf.c | 11 +++++++++++ reactos/lib/sdk/crt/math/coshf.c | 11 +++++++++++ reactos/lib/sdk/crt/math/expf.c | 11 +++++++++++ reactos/lib/sdk/crt/math/log10f.c | 11 +++++++++++ reactos/lib/sdk/crt/math/modff.c | 17 +++++++++++++++++ reactos/lib/sdk/crt/math/sinhf.c | 11 +++++++++++ reactos/lib/sdk/crt/math/tanf.c | 11 +++++++++++ reactos/lib/sdk/crt/math/tanhf.c | 11 +++++++++++ 13 files changed, 151 insertions(+) create mode 100644 reactos/lib/sdk/crt/math/_chgsignf.c create mode 100644 reactos/lib/sdk/crt/math/_copysignf.c create mode 100644 reactos/lib/sdk/crt/math/_hypotf.c create mode 100644 reactos/lib/sdk/crt/math/asinf.c create mode 100644 reactos/lib/sdk/crt/math/atan2f.c create mode 100644 reactos/lib/sdk/crt/math/atanf.c create mode 100644 reactos/lib/sdk/crt/math/coshf.c create mode 100644 reactos/lib/sdk/crt/math/expf.c create mode 100644 reactos/lib/sdk/crt/math/log10f.c create mode 100644 reactos/lib/sdk/crt/math/modff.c create mode 100644 reactos/lib/sdk/crt/math/sinhf.c create mode 100644 reactos/lib/sdk/crt/math/tanf.c create mode 100644 reactos/lib/sdk/crt/math/tanhf.c diff --git a/reactos/lib/sdk/crt/math/_chgsignf.c b/reactos/lib/sdk/crt/math/_chgsignf.c new file mode 100644 index 00000000000..b4f0f439984 --- /dev/null +++ b/reactos/lib/sdk/crt/math/_chgsignf.c @@ -0,0 +1,10 @@ + +#include + +_Check_return_ +float +_chgsignf(_In_ float x) +{ + return (float)_chgsign((double)x); +} + diff --git a/reactos/lib/sdk/crt/math/_copysignf.c b/reactos/lib/sdk/crt/math/_copysignf.c new file mode 100644 index 00000000000..5a59fc9f9e7 --- /dev/null +++ b/reactos/lib/sdk/crt/math/_copysignf.c @@ -0,0 +1,12 @@ + +#include + +_Check_return_ +float +__cdecl +_copysignf( + _In_ float x, + _In_ float y) +{ + return (float)_copysign((double)x, (double)y); +} diff --git a/reactos/lib/sdk/crt/math/_hypotf.c b/reactos/lib/sdk/crt/math/_hypotf.c new file mode 100644 index 00000000000..34c0009cab9 --- /dev/null +++ b/reactos/lib/sdk/crt/math/_hypotf.c @@ -0,0 +1,12 @@ + +#include + +_Check_return_ +float +__cdecl +_hypotf( + _In_ float x, + _In_ float y) +{ + return (float)_hypot((double)x, (double)y); +} diff --git a/reactos/lib/sdk/crt/math/asinf.c b/reactos/lib/sdk/crt/math/asinf.c new file mode 100644 index 00000000000..278ce4dcbd3 --- /dev/null +++ b/reactos/lib/sdk/crt/math/asinf.c @@ -0,0 +1,11 @@ + +#include + +_Check_return_ +float +__cdecl +asinf( + _In_ float x) +{ + return (float)asin((double)x); +} diff --git a/reactos/lib/sdk/crt/math/atan2f.c b/reactos/lib/sdk/crt/math/atan2f.c new file mode 100644 index 00000000000..c16a281679a --- /dev/null +++ b/reactos/lib/sdk/crt/math/atan2f.c @@ -0,0 +1,12 @@ + +#include + +_Check_return_ +float +__cdecl +atan2f( + _In_ float x, + _In_ float y) +{ + return (float)atan2((double)x,(double)y); +} diff --git a/reactos/lib/sdk/crt/math/atanf.c b/reactos/lib/sdk/crt/math/atanf.c new file mode 100644 index 00000000000..16cd3a66e10 --- /dev/null +++ b/reactos/lib/sdk/crt/math/atanf.c @@ -0,0 +1,11 @@ + +#include + +_Check_return_ +float +__cdecl +atanf( + _In_ float x) +{ + return (float)atan((double)x); +} diff --git a/reactos/lib/sdk/crt/math/coshf.c b/reactos/lib/sdk/crt/math/coshf.c new file mode 100644 index 00000000000..f4c2e1f0299 --- /dev/null +++ b/reactos/lib/sdk/crt/math/coshf.c @@ -0,0 +1,11 @@ + +#include + +_Check_return_ +float +__cdecl +coshf( + _In_ float x) +{ + return (float)cosh((double)x); +} diff --git a/reactos/lib/sdk/crt/math/expf.c b/reactos/lib/sdk/crt/math/expf.c new file mode 100644 index 00000000000..850bd7ad201 --- /dev/null +++ b/reactos/lib/sdk/crt/math/expf.c @@ -0,0 +1,11 @@ + +#include + +_Check_return_ +float +__cdecl +expf( + _In_ float x) +{ + return (float)exp((double)x); +} diff --git a/reactos/lib/sdk/crt/math/log10f.c b/reactos/lib/sdk/crt/math/log10f.c new file mode 100644 index 00000000000..42a62764a24 --- /dev/null +++ b/reactos/lib/sdk/crt/math/log10f.c @@ -0,0 +1,11 @@ + +#include + +_Check_return_ +float +__cdecl +log10f( + _In_ float x) +{ + return (float)log10((double)x); +} diff --git a/reactos/lib/sdk/crt/math/modff.c b/reactos/lib/sdk/crt/math/modff.c new file mode 100644 index 00000000000..b894cac1198 --- /dev/null +++ b/reactos/lib/sdk/crt/math/modff.c @@ -0,0 +1,17 @@ + +#include + +_Check_return_ +float +__cdecl +modff( + _In_ float x, + _Out_ float *y) +{ + double _Di, _Df; + + _Df = modf((double)x,&_Di); + *y = (float)_Di; + + return (float)_Df; +} diff --git a/reactos/lib/sdk/crt/math/sinhf.c b/reactos/lib/sdk/crt/math/sinhf.c new file mode 100644 index 00000000000..f26fa6319e2 --- /dev/null +++ b/reactos/lib/sdk/crt/math/sinhf.c @@ -0,0 +1,11 @@ + +#include + +_Check_return_ +float +__cdecl +sinhf( + _In_ float x) +{ + return (float)sinh((double)x); +} diff --git a/reactos/lib/sdk/crt/math/tanf.c b/reactos/lib/sdk/crt/math/tanf.c new file mode 100644 index 00000000000..200a17fcb2d --- /dev/null +++ b/reactos/lib/sdk/crt/math/tanf.c @@ -0,0 +1,11 @@ + +#include + +_Check_return_ +float +__cdecl +tanf( + _In_ float x) +{ + return (float)tan((double)x); +} diff --git a/reactos/lib/sdk/crt/math/tanhf.c b/reactos/lib/sdk/crt/math/tanhf.c new file mode 100644 index 00000000000..c48b195c9d9 --- /dev/null +++ b/reactos/lib/sdk/crt/math/tanhf.c @@ -0,0 +1,11 @@ + +#include + +_Check_return_ +float +__cdecl +tanhf( + _In_ float x) +{ + return (float)tanh((double)x); +}