Commit graph

27 commits

Author SHA1 Message Date
Mițca Dumitru
32b9437c13 LibM: Add remainder{f, l}
These just forward their arguments to fmod, but I think that should be
fine.
2021-03-14 21:43:08 +01:00
Mițca Dumitru
e4197b7854 LibM: Define HUGE_VAL{F,L} in terms of compiler builtins 2021-03-14 21:43:08 +01:00
Mițca Dumitru
e9533da0e7 LibM: Define MAXFLOAT
Looks like a POSIX extension
2021-03-14 21:43:08 +01:00
Mițca Dumitru
86ee9211be LibM: Define FLT_EVAL_METHOD, float_t and double_t 2021-03-14 21:43:08 +01:00
Mițca Dumitru
1f1a4f488f LibM: Declare ldexpl in math.h
It was already defined, but it wasn't declared in the header
2021-03-14 21:43:08 +01:00
Mițca Dumitru
93c554f6bd LibM: Add the gamma family of functions 2021-03-14 21:43:08 +01:00
Mițca Dumitru
7aac174bc8 LibM: Organise math.h so it is less of a wall of functions
The categories are the same categories used by cppreference on its page
for numeric functions.
2021-03-14 21:43:08 +01:00
Mițca Dumitru
c9601cdee3 LibM: Implement the missing parts of the round family 2021-03-14 21:43:08 +01:00
Mițca Dumitru
03b2d30836 LibM: Add missing float and long double function variants 2021-03-14 21:43:08 +01:00
Linus Groh
caa8f3d3bf LibM: Implement tanf() in terms of tan() with casts
Lazy, but it works for now. :^)
2021-03-13 22:44:16 +01:00
Mițca Dumitru
b07310dc8b LibM: Add nan{f, l} 2021-03-09 07:28:06 +01:00
Mițca Dumitru
efe4845c56 LibM: Implement more rounding functions
This patch implements the entire rint family, while taking into account
the current rounding mode, and implements ceil, round, trunc, and floor
for types which they weren't before.
2021-03-09 07:28:06 +01:00
Mițca Dumitru
88d342d007 LibM: Implement the frexp family 2021-03-09 07:28:06 +01:00
Mițca Dumitru
b274120b3c LibM: Implement copysign for float and long double 2021-03-09 07:28:06 +01:00
Mițca Dumitru
87b61b0eef LibM: Add scalbn and associated functions
Also implement ldexp in terms of them, and add ldexpl
2021-03-09 07:28:06 +01:00
Mițca Dumitru
352b383280 LibM: Add ilogb and logb 2021-03-09 07:28:06 +01:00
Mițca Dumitru
190952675e LibM: Specialiase FloatExtractor for long double as well 2021-03-09 07:28:06 +01:00
Mițca Dumitru
42a8186728 LibM: Define floating point comparsion macros 2021-03-09 07:28:06 +01:00
Mițca Dumitru
70737b42b2 LibM: Define math_errhandling and associated macros 2021-03-09 07:28:06 +01:00
Nick Wanninger
c3f417aa1e LibM: optimized (branchless) copysign 2021-03-06 09:42:06 +01:00
Andreas Kling
9f8a9dba0b LibM: Add naive implementation of copysign() 2021-03-05 20:46:25 +01:00
Andreas Kling
5d180d1f99 Everywhere: Rename ASSERT => VERIFY
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)

Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.

We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
2021-02-23 20:56:54 +01:00
Andreas Kling
0269578d3e LibM: Implement nextafter() and nexttoward()
Patch from Anonymous.
2021-02-05 12:27:23 +01:00
Andreas Kling
9d471ea923 LibM: Build and install the LibM test
This test seems to be full of wrong, but at least now we build it and
place it in /usr/Tests/LibM/ so that we can fix it.
2021-02-05 09:50:08 +01:00
Andreas Kling
6622ad8895 LibM: Improve accuracy of rounding related functions
Patch from Anonymous.
2021-02-05 09:38:45 +01:00
Linus Groh
c46056122a LibM: Add nextafter() and nexttoward() stubs
Only thing missing for Python to build the _math module! :^)
2021-01-18 22:28:56 +01:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00