Created attachment 263688 [details] path to libm sources The attached patch addresses an issue raised in https://lists.freebsd.org/archives/freebsd-hackers/2025-September/005052.html For pow(0.,0.), the returned value is 1. For cpow(z,z) with z = CMPLX(0,0), the returned value is 0. See the note in pow(3) man page. The patch brings FreeBSD's libm into agreement with glibc.
The patch removes s_remquof.S from sources on amd64 (it seems). Was it intended? If yes, does the file itself should be kept in sources?
(In reply to Konstantin Belousov from comment #1) No. It was no intended. I attached the wrong patch. I attached the correct one shortly.
Created attachment 263718 [details] Corrected patch Here's the patch that only touches s_cpow[fl].c
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=8b41ba845c7e10b5f241a1f944fe9a8e19ad75a9 commit 8b41ba845c7e10b5f241a1f944fe9a8e19ad75a9 Author: Steve Kargl <kargl@FreeBSD.org> AuthorDate: 2025-09-11 16:38:17 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2025-09-12 02:36:27 +0000 lib/msun: cpow{,f,l}(CMLX(0.0, 0.0)) should return 1.0 PR: 289447 MFC after: 1 week lib/msun/src/s_cpow.c | 5 ++++- lib/msun/src/s_cpowf.c | 5 ++++- lib/msun/src/s_cpowl.c | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-)
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=92801ed02423bd8f7237223168eaa194b28d147f commit 92801ed02423bd8f7237223168eaa194b28d147f Author: Steve Kargl <kargl@FreeBSD.org> AuthorDate: 2025-09-11 16:38:17 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2025-09-19 00:58:53 +0000 lib/msun: cpow{,f,l}(CMLX(0.0, 0.0)) should return 1.0 PR: 289447 (cherry picked from commit 8b41ba845c7e10b5f241a1f944fe9a8e19ad75a9) lib/msun/src/s_cpow.c | 5 ++++- lib/msun/src/s_cpowf.c | 5 ++++- lib/msun/src/s_cpowl.c | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=6f59cb79e84a86d7b864d709652ec57b6928a6cf commit 6f59cb79e84a86d7b864d709652ec57b6928a6cf Author: Steve Kargl <kargl@FreeBSD.org> AuthorDate: 2025-09-11 16:38:17 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2025-09-19 00:59:55 +0000 lib/msun: cpow{,f,l}(CMLX(0.0, 0.0)) should return 1.0 PR: 289447 (cherry picked from commit 8b41ba845c7e10b5f241a1f944fe9a8e19ad75a9) lib/msun/src/s_cpow.c | 5 ++++- lib/msun/src/s_cpowf.c | 5 ++++- lib/msun/src/s_cpowl.c | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-)