Bug 21601 – std.math : pow(float/double, -2) produces sometimes wrong result

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2021-02-01T18:46:24Z
Last change time
2021-03-01T13:50:52Z
Keywords
pull
Assigned to
No Owner
Creator
Berni44

Comments

Comment #0 by bugzilla — 2021-02-01T18:46:24Z
Both unittests fail: import std.math : pow; unittest { assert(pow(-513645318757045764096.0f,-2) > 0.0); assert(pow(-1.6299717435255677e+154,-2) < 0.0); }
Comment #1 by bugzilla — 2021-02-01T19:04:04Z
Ups, should be "> 0.0" in the second test.
Comment #2 by dlang-bot — 2021-02-02T10:31:21Z
@berni44 created dlang/phobos pull request #7783 "Fix Issue 21601 - std.math : pow(float/double, -2) produces sometimes wrong result" fixing this issue: - Fix Issue 21601 - std.math : pow(float/double, -2) produces sometimes wrong result https://github.com/dlang/phobos/pull/7783
Comment #3 by dlang-bot — 2021-03-01T13:50:52Z
dlang/phobos pull request #7783 "Fix Issue 21601 - std.math : pow(float/double, -2) produces sometimes wrong result" was merged into master: - bab6c2b2114c067fac127b9291c2f7fd98d3ae53 by berni44: Fix Issue 21601 - std.math : pow(float/double, -2) produces sometimes wrong result https://github.com/dlang/phobos/pull/7783