From 6187cf72cc3de15ed78b4457577dd7dfb60b34ea Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Mon, 2 May 2022 20:23:32 +0200 Subject: [PATCH] LibM: Implement fma --- Userland/Libraries/LibM/math.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Userland/Libraries/LibM/math.cpp b/Userland/Libraries/LibM/math.cpp index 5cd19ecc22..9472fff710 100644 --- a/Userland/Libraries/LibM/math.cpp +++ b/Userland/Libraries/LibM/math.cpp @@ -1116,6 +1116,22 @@ float fminf(float x, float y) NOEXCEPT return x < y ? x : y; } +// https://pubs.opengroup.org/onlinepubs/9699919799/functions/fma.html +long double fmal(long double x, long double y, long double z) NOEXCEPT +{ + return (x * y) + z; +} + +double fma(double x, double y, double z) NOEXCEPT +{ + return (x * y) + z; +} + +float fmaf(float x, float y, float z) NOEXCEPT +{ + return (x * y) + z; +} + long double nearbyintl(long double value) NOEXCEPT { return internal_to_integer(value, RoundingMode { fegetround() });