On Tuesday, 7 July 2020 at 23:52:05 UTC, 9il wrote:
On Tuesday, 7 July 2020 at 16:38:39 UTC, kinke wrote:
So wouldn't the trivial 'fix' be using `strtod` for double literals and `strtof` for floats? [For LDC, we wouldn't rely on the host C runtime or a mir implementation, but use LLVM facilities anyway.]

This should work if the C runtime handles the values correctly.

I've just opened a PR for DMD (and LDC too): https://github.com/dlang/dmd/pull/11387

Does this actually mean DMD wouldn't be able to compile itself with DigigtalMars C runtime?

Sorry, I don't understand. - I think this excess precision was at some point considered a feature (but probably only for D, not for DigitalMars C), there's even a test making sure 0.9L and 0.9 are parsed to the same compile-time value.
              • ... John Colvin via Digitalmars-d-announce
              • ... H. S. Teoh via Digitalmars-d-announce
              • ... Steven Schveighoffer via Digitalmars-d-announce
              • ... H. S. Teoh via Digitalmars-d-announce
              • ... 9il via Digitalmars-d-announce
              • ... Adam D. Ruppe via Digitalmars-d-announce
              • ... Dibyendu Majumdar via Digitalmars-d-announce
              • ... Joseph Rushton Wakeling via Digitalmars-d-announce
    • Re: Decimal string... kinke via Digitalmars-d-announce
      • Re: Decimal st... 9il via Digitalmars-d-announce
        • Re: Decima... kinke via Digitalmars-d-announce
  • Re: Decimal string to f... Walter Bright via Digitalmars-d-announce

Reply via email to