Bug 20284 – CustomFloat.max_10_exp does not work for types with too many digits in exponent

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2019-10-08T17:33:15Z
Last change time
2019-10-21T15:33:53Z
Keywords
pull
Assigned to
No Owner
Creator
berni44

Comments

Comment #0 by bugzilla — 2019-10-08T17:33:15Z
CustomFloat!(15, 16).max_10_exp == -2147483648 should be 9864. The reason is, that 16 bit exponents do not fit into real, which has only 15 bits on x86_64. It is probably possible to calculate the value without the need to convert to real, but the question is, if this is of any help. CustomFloats are used by converting to real, doing the calculation there, and then converting back. What I want to say, such CustomFloats cannot be used and maybe the solution is to restrict them to exponents with length less than that of real.
Comment #1 by dlang-bot — 2019-10-20T17:39:01Z
@berni44 updated dlang/phobos pull request #7219 "Fix issues 20260, 20281, 20284 - Limitations of CustomFloat." fixing this issue: - Fix issues 20260, 20281, 20284 - Limitations of CustomFloat. https://github.com/dlang/phobos/pull/7219
Comment #2 by dlang-bot — 2019-10-21T15:33:53Z
dlang/phobos pull request #7219 "Fix issues 20260, 20281, 20284 - Limitations of CustomFloat." was merged into master: - adff945fee1c61dee2936ecb0238729a9b437d0a by Bernhard Seckinger: Fix issues 20260, 20281, 20284 - Limitations of CustomFloat. https://github.com/dlang/phobos/pull/7219