[Issue 20284] New: CustomFloat.max_10_exp does not work for types with too many digits in exponent

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 8 17:33:15 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=20284

          Issue ID: 20284
           Summary: CustomFloat.max_10_exp does not work for types with
                    too many digits in exponent
           Product: D
           Version: D2
          Hardware: x86_64
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: bugzilla at d-ecke.de

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.

--


More information about the Digitalmars-d-bugs mailing list