File 0457-Fix-abs-0.0-to-return-0.0.patch of Package erlang
From bb48871e00b50e7451dad3d1dd15bb0051c90d6e Mon Sep 17 00:00:00 2001
From: Jan Uhlig <juhlig@hnc-agency.org>
Date: Wed, 20 Sep 2023 11:52:54 +0200
Subject: [PATCH] Fix abs(-0.0) to return 0.0
---
erts/emulator/beam/erl_bif_guard.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/erts/emulator/beam/erl_bif_guard.c b/erts/emulator/beam/erl_bif_guard.c
index b4caaf6e38..61ded93452 100644
--- a/erts/emulator/beam/erl_bif_guard.c
+++ b/erts/emulator/beam/erl_bif_guard.c
@@ -89,7 +89,7 @@ BIF_RETTYPE abs_1(BIF_ALIST_1)
FloatDef f;
GET_DOUBLE(BIF_ARG_1, f);
- if (f.fd < 0.0) {
+ if (f.fd <= 0.0) {
hp = HeapFragOnlyAlloc(BIF_P, FLOAT_SIZE_OBJECT);
f.fd = fabs(f.fd);
res = make_float(hp);
--
2.35.3