Bug 20282 – CustomFloat.dig fails at some values.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-10-08T14:24:43Z
Last change time
2019-10-20T17:48:56Z
Keywords
pull
Assigned to
No Owner
Creator
berni44

Comments

Comment #0 by bugzilla — 2019-10-08T14:24:43Z
CustomFloat!(10,5).dig == 2, but should be 3 in my oppinion. With 10 bits in the mantissa (without leading 1) you can represent multiples of 0.5^^10 = 0.0009765625. This is IMHO enough for 3 digits of precision, because all numbers between 0.001 and 0.999 have a different representation.
Comment #1 by dlang-bot — 2019-10-17T14:10:40Z
@berni44 created dlang/phobos pull request #7234 "Fix Issue 20282 - CustomFloat.dig fails at some values." fixing this issue: - Fix Issue 20282 - CustomFloat.dig fails at some values. https://github.com/dlang/phobos/pull/7234
Comment #2 by dlang-bot — 2019-10-20T17:48:56Z
dlang/phobos pull request #7234 "Fix Issue 20282 - CustomFloat.dig fails at some values." was merged into master: - 072095ebead4caaa4f46b83f17ba497f66e239ab by Bernhard Seckinger: Fix Issue 20282 - CustomFloat.dig fails at some values. https://github.com/dlang/phobos/pull/7234