Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-08-08 Thread Bruce Carneal via Digitalmars-d-announce
On Saturday, 8 August 2020 at 22:13:57 UTC, Bruce Carneal wrote: Per the original post in this thread, the current compiler doesn't convert decimal floating point literals to binary form correctly in all normal cases. Assuming people actually want to be correct/consistent to the last bit

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-08-08 Thread Bruce Carneal via Digitalmars-d-announce
On Saturday, 8 August 2020 at 18:16:30 UTC, Avrina wrote: On Friday, 7 August 2020 at 13:24:36 UTC, Andrei Alexandrescu wrote: On 7/7/20 8:04 AM, Steven Schveighoffer wrote: On 7/7/20 7:13 AM, 9il wrote: On Tuesday, 7 July 2020 at 07:49:02 UTC, Walter Bright wrote: On 7/5/2020 5:46 AM,

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-08-08 Thread Joseph Rushton Wakeling via Digitalmars-d-announce
On Saturday, 8 August 2020 at 18:16:30 UTC, Avrina wrote: there's no shame to it any more than it is What's the purpose of that? If someone needs Mir, they can just add it as a dependency in dub. This will just be adding more bloat to drubtime. The development surrounding D seems to have a

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-08-08 Thread Avrina via Digitalmars-d-announce
On Friday, 7 August 2020 at 13:24:36 UTC, Andrei Alexandrescu wrote: On 7/7/20 8:04 AM, Steven Schveighoffer wrote: On 7/7/20 7:13 AM, 9il wrote: On Tuesday, 7 July 2020 at 07:49:02 UTC, Walter Bright wrote: On 7/5/2020 5:46 AM, Joseph Rushton Wakeling wrote: On Sunday, 5 July 2020 at

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-08-07 Thread Andrei Alexandrescu via Digitalmars-d-announce
On 7/7/20 8:04 AM, Steven Schveighoffer wrote: On 7/7/20 7:13 AM, 9il wrote: On Tuesday, 7 July 2020 at 07:49:02 UTC, Walter Bright wrote: On 7/5/2020 5:46 AM, Joseph Rushton Wakeling wrote: On Sunday, 5 July 2020 at 11:07:55 UTC, 9il wrote: There is no risk for DMD and DFL to depend on a

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-11 Thread Walter Bright via Digitalmars-d-announce
On 6/21/2020 8:24 AM, 9il wrote: [0] https://github.com/libmir/mir-algorithm [1] http://mir-algorithm.libmir.org/mir_parse.html#.fromString[2] https://issues.dlang.org/show_bug.cgi?id=20951 [3] https://issues.dlang.org/show_bug.cgi?id=20952 [4] https://issues.dlang.org/show_bug.cgi?id=20953

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-11 Thread Joseph Rushton Wakeling via Digitalmars-d-announce
On Saturday, 11 July 2020 at 10:58:31 UTC, Dibyendu Majumdar wrote: This argument seems a bit odd given ... when D code was contributed to gcc, did you follow the FSF rule of assigning copyright to FSF? The issue is about maintenance of the codebase, not about who owns the copyright.

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-11 Thread Dibyendu Majumdar via Digitalmars-d-announce
On Tuesday, 7 July 2020 at 07:49:02 UTC, Walter Bright wrote: That's right, it's not about the licensing. It's that the DLF should control the code it distributes. Businesses will not want to commit to a balkanized project. The proposal is for Mir to become a central required component of

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-08 Thread Walter Bright via Digitalmars-d-announce
On 7/7/2020 3:58 AM, 9il wrote: For a high tech real markets (airspace, automotive, science, military-industrial complex) having a correct decimal literal parsing has a little but absolutely mandatory value. If SpaceX is lending a rocket, they want it located on the platform, something around

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread 9il via Digitalmars-d-announce
On Tuesday, 7 July 2020 at 23:56:45 UTC, kinke wrote: 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

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread kinke via Digitalmars-d-announce
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

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread 9il via Digitalmars-d-announce
On Tuesday, 7 July 2020 at 16:38:39 UTC, kinke wrote: On Saturday, 4 July 2020 at 20:35:48 UTC, Walter Bright wrote: On 6/21/2020 8:24 AM, 9il wrote: [...] Great work! Would you like to add it to dmd? AFAIU, the 'problem' is that *all* floating-point literals are parsed as real_t values,

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread H. S. Teoh via Digitalmars-d-announce
On Tue, Jul 07, 2020 at 01:47:59PM -0400, Steven Schveighoffer via Digitalmars-d-announce wrote: > On 7/7/20 1:37 PM, H. S. Teoh wrote: > > cf. the repeated problems we had over the years with libcurl, zlib, > > etc. > > zlib is actually included copy-paste style in Phobos [1]. So it's >

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread Petar via Digitalmars-d-announce
On Tuesday, 7 July 2020 at 12:14:16 UTC, Guillaume Piolat wrote: Phobos is the stdlib of the language. Mir is not. I'm not sure why you point this out. No one is arguing that it is. On the other hand, it does many things better already. Likewise, you've made the std.experimental.allocator

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread Steven Schveighoffer via Digitalmars-d-announce
On 7/7/20 1:37 PM, H. S. Teoh wrote: cf. the repeated problems we had over the years with libcurl, zlib, etc. zlib is actually included copy-paste style in Phobos [1]. So it's interesting that you cite it as an example of causing problems because we don't include a copy of it. -Steve [1]

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread H. S. Teoh via Digitalmars-d-announce
On Tue, Jul 07, 2020 at 03:08:33PM +, Adam D. Ruppe via Digitalmars-d-announce wrote: > On Tuesday, 7 July 2020 at 13:00:04 UTC, Steven Schveighoffer wrote: > > Doing that these days would be silly. You can depend on a specific > > version of a repository without problems. > > I always have

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread kinke via Digitalmars-d-announce
On Saturday, 4 July 2020 at 20:35:48 UTC, Walter Bright wrote: On 6/21/2020 8:24 AM, 9il wrote: So excited to finally announce we can correctly parse floating-point numbers according to IEEE round half-to-even (bankers) rule like in C/C++, Rust, and others. Great work! Would you like to add

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread John Colvin via Digitalmars-d-announce
On Tuesday, 7 July 2020 at 15:08:33 UTC, Adam D. Ruppe wrote: On Tuesday, 7 July 2020 at 13:00:04 UTC, Steven Schveighoffer wrote: Doing that these days would be silly. You can depend on a specific version of a repository without problems. I always have problems when trying to do that. git

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread Steven Schveighoffer via Digitalmars-d-announce
On 7/7/20 11:08 AM, Adam D. Ruppe wrote: On Tuesday, 7 July 2020 at 13:00:04 UTC, Steven Schveighoffer wrote: Doing that these days would be silly. You can depend on a specific version of a repository without problems. I always have problems when trying to do that. git submodules bring

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread Joseph Rushton Wakeling via Digitalmars-d-announce
On Tuesday, 7 July 2020 at 12:04:43 UTC, Steven Schveighoffer wrote: Guys, this is all open source, all licensed identically. There are ways to solve this. Practically speaking, just because DMD depends on Mir, doesn't mean that Mir has control over how the dependency works. DMD can depend on

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread Adam D. Ruppe via Digitalmars-d-announce
On Tuesday, 7 July 2020 at 13:00:04 UTC, Steven Schveighoffer wrote: Doing that these days would be silly. You can depend on a specific version of a repository without problems. I always have problems when trying to do that. git submodules bring pretty consistent pain in my experience. But

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread Adam D. Ruppe via Digitalmars-d-announce
On Tuesday, 7 July 2020 at 13:01:10 UTC, 9il wrote: This would be good advertising for DFL, haha. I don't know what you mean...

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread 9il via Digitalmars-d-announce
On Tuesday, 7 July 2020 at 12:52:35 UTC, Adam D. Ruppe wrote: On Tuesday, 7 July 2020 at 07:49:02 UTC, Walter Bright wrote: Businesses will not want to commit to a balkanized project. It's been ages since I worked on a software project for a business that didn't have many random third (and

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread Steven Schveighoffer via Digitalmars-d-announce
On 7/7/20 8:52 AM, Adam D. Ruppe wrote: On Tuesday, 7 July 2020 at 07:49:02 UTC, Walter Bright wrote: Businesses will not want to commit to a balkanized project. It's been ages since I worked on a software project for a business that didn't have many random third (and fourth and fifth and

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread Adam D. Ruppe via Digitalmars-d-announce
On Tuesday, 7 July 2020 at 07:49:02 UTC, Walter Bright wrote: Businesses will not want to commit to a balkanized project. It's been ages since I worked on a software project for a business that didn't have many random third (and fourth and fifth and sixth and seventh.) party

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread 9il via Digitalmars-d-announce
On Tuesday, 7 July 2020 at 12:04:43 UTC, Steven Schveighoffer wrote: On 7/7/20 7:13 AM, 9il wrote: [...] Guys, this is all open source, all licensed identically. There are ways to solve this. Practically speaking, just because DMD depends on Mir, doesn't mean that Mir has control over how

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread 9il via Digitalmars-d-announce
On Tuesday, 7 July 2020 at 12:14:16 UTC, Guillaume Piolat wrote: On Tuesday, 7 July 2020 at 10:58:25 UTC, 9il wrote: From a business point of view, having slightly more correct string to float conversion holds very little value. I'll stick with sscanf thanks... For a high tech real markets

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread 9il via Digitalmars-d-announce
On Tuesday, 7 July 2020 at 12:35:57 UTC, jmh530 wrote: On Tuesday, 7 July 2020 at 12:33:40 UTC, jmh530 wrote: On Tuesday, 7 July 2020 at 12:14:16 UTC, Guillaume Piolat wrote: [...] Is that not an example of how Steve thinks it should work? Both are Boost licensed. mir-core has no external

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread jmh530 via Digitalmars-d-announce
On Tuesday, 7 July 2020 at 12:33:40 UTC, jmh530 wrote: On Tuesday, 7 July 2020 at 12:14:16 UTC, Guillaume Piolat wrote: [snip] Likewise, you've made the std.experimental.allocator on DUB depends on mir-core... Is that not an example of how Steve thinks it should work? Both are Boost

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread jmh530 via Digitalmars-d-announce
On Tuesday, 7 July 2020 at 12:14:16 UTC, Guillaume Piolat wrote: [snip] Likewise, you've made the std.experimental.allocator on DUB depends on mir-core... Is that not an example of how Steve thinks it should work? Both are Boost licensed. mir-core has no external dependencies. Ilya could

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread Guillaume Piolat via Digitalmars-d-announce
On Tuesday, 7 July 2020 at 10:58:25 UTC, 9il wrote: From a business point of view, having slightly more correct string to float conversion holds very little value. I'll stick with sscanf thanks... For a high tech real markets (airspace, automotive, science, military-industrial complex)

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread Steven Schveighoffer via Digitalmars-d-announce
On 7/7/20 7:13 AM, 9il wrote: On Tuesday, 7 July 2020 at 07:49:02 UTC, Walter Bright wrote: On 7/5/2020 5:46 AM, Joseph Rushton Wakeling wrote: On Sunday, 5 July 2020 at 11:07:55 UTC, 9il wrote: There is no risk for DMD and DFL to depend on a Mir's Boost licensed library. If something happens

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread 9il via Digitalmars-d-announce
On Tuesday, 7 July 2020 at 07:49:02 UTC, Walter Bright wrote: On 7/5/2020 5:46 AM, Joseph Rushton Wakeling wrote: On Sunday, 5 July 2020 at 11:07:55 UTC, 9il wrote: There is no risk for DMD and DFL to depend on a Mir's Boost licensed library. If something happens with Mir or Mir change the

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread 9il via Digitalmars-d-announce
On Tuesday, 7 July 2020 at 09:28:26 UTC, Guillaume Piolat wrote: On Tuesday, 7 July 2020 at 07:49:02 UTC, Walter Bright wrote: That's right, it's not about the licensing. It's that the DLF should control the code it distributes. Businesses will not want to commit to a balkanized project.

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread Guillaume Piolat via Digitalmars-d-announce
On Tuesday, 7 July 2020 at 07:49:02 UTC, Walter Bright wrote: That's right, it's not about the licensing. It's that the DLF should control the code it distributes. Businesses will not want to commit to a balkanized project. From a business point of view, having slightly more correct string

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread Walter Bright via Digitalmars-d-announce
On 7/5/2020 5:46 AM, Joseph Rushton Wakeling wrote: On Sunday, 5 July 2020 at 11:07:55 UTC, 9il wrote: There is no risk for DMD and DFL to depend on a Mir's Boost licensed library. If something happens with Mir or Mir change the license, DFL will be able to fork the required code at any point

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-06 Thread Jacob Carlborg via Digitalmars-d-announce
On Sunday, 5 July 2020 at 14:29:22 UTC, IGotD- wrote: It's a resource question again. I'm all for that for example D should have a native alternative to curl including SSL/TLS support. If someone is willing to invest the man hours into such project, I'm all for it. Nim went that way having

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-05 Thread IGotD- via Digitalmars-d-announce
On Sunday, 5 July 2020 at 12:46:58 UTC, Joseph Rushton Wakeling wrote: Can't speak for Walter or the D foundation here, but I'm not sure the concern is really about licensing. It's about putting in place a required dependency on code where maintenance decisions are outside the hands of the

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-05 Thread Joseph Rushton Wakeling via Digitalmars-d-announce
On Sunday, 5 July 2020 at 11:07:55 UTC, 9il wrote: There is no risk for DMD and DFL to depend on a Mir's Boost licensed library. If something happens with Mir or Mir change the license, DFL will be able to fork the required code at any point in the Boost licensed part of git history. Can't

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-05 Thread 9il via Digitalmars-d-announce
On Sunday, 5 July 2020 at 10:39:49 UTC, Walter Bright wrote: On 7/5/2020 3:35 AM, Walter Bright wrote: All of DMD, Druntime, and Phobos use Boost, except for Curl and the zip library (which we probably shouldn't have added). Also, there are no dependencies on Curl and zip. We don't

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-05 Thread Walter Bright via Digitalmars-d-announce
On 7/5/2020 3:35 AM, Walter Bright wrote: All of DMD, Druntime, and Phobos use Boost, except for Curl and the zip library (which we probably shouldn't have added). Also, there are no dependencies on Curl and zip. We don't distribute the C libraries, we use whatever is on the user's system.

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-05 Thread Walter Bright via Digitalmars-d-announce
On 7/5/2020 1:56 AM, 9il wrote: On Sunday, 5 July 2020 at 08:15:53 UTC, Walter Bright wrote: It doesn't work quite like that. The D Language Foundation controls it. Andrei, Atila, and myself control it only as far as we DLF empowers us to, which can change. Official parts of the DMD

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-05 Thread 9il via Digitalmars-d-announce
On Sunday, 5 July 2020 at 08:15:53 UTC, Walter Bright wrote: It doesn't work quite like that. The D Language Foundation controls it. Andrei, Atila, and myself control it only as far as we DLF empowers us to, which can change. Official parts of the DMD distribution have to be controlled by

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-05 Thread 9il via Digitalmars-d-announce
On Sunday, 5 July 2020 at 08:15:53 UTC, Walter Bright wrote: On 7/5/2020 12:24 AM, 9il wrote: On Sunday, 5 July 2020 at 06:23:35 UTC, Walter Bright wrote: On 7/4/2020 8:09 PM, 9il wrote: Does the float parsing code require bignum? Yes. The decimal float parsing requires big integer arithmetic

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-05 Thread Walter Bright via Digitalmars-d-announce
On 7/5/2020 12:24 AM, 9il wrote: On Sunday, 5 July 2020 at 06:23:35 UTC, Walter Bright wrote: On 7/4/2020 8:09 PM, 9il wrote: Does the float parsing code require bignum? Yes. The decimal float parsing requires big integer arithmetic and software Arbitrary precision or simply a fixed amount

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-05 Thread 9il via Digitalmars-d-announce
On Sunday, 5 July 2020 at 06:23:35 UTC, Walter Bright wrote: On 7/4/2020 8:09 PM, 9il wrote: On Saturday, 4 July 2020 at 20:35:48 UTC, Walter Bright wrote: On 6/21/2020 8:24 AM, 9il wrote: So excited to finally announce we can correctly parse floating-point numbers according to IEEE round

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-05 Thread Walter Bright via Digitalmars-d-announce
On 7/4/2020 8:09 PM, 9il wrote: On Saturday, 4 July 2020 at 20:35:48 UTC, Walter Bright wrote: On 6/21/2020 8:24 AM, 9il wrote: So excited to finally announce we can correctly parse floating-point numbers according to IEEE round half-to-even (bankers) rule like in C/C++, Rust, and others.

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-04 Thread 9il via Digitalmars-d-announce
On Saturday, 4 July 2020 at 20:35:48 UTC, Walter Bright wrote: On 6/21/2020 8:24 AM, 9il wrote: So excited to finally announce we can correctly parse floating-point numbers according to IEEE round half-to-even (bankers) rule like in C/C++, Rust, and others. Great work! Would you like to add

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-04 Thread Walter Bright via Digitalmars-d-announce
On 6/21/2020 8:24 AM, 9il wrote: So excited to finally announce we can correctly parse floating-point numbers according to IEEE round half-to-even (bankers) rule like in C/C++, Rust, and others. Great work! Would you like to add it to dmd?

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-06-22 Thread Dukc via Digitalmars-d-announce
On Monday, 22 June 2020 at 12:07:26 UTC, 9il wrote: On Monday, 22 June 2020 at 12:04:13 UTC, 9il wrote: So the algorithm would look like: 1. Parse hexadecimal big integer 2. Parse exponent 3. Cast big integer to `Fp` with a specific number of meaningful bits (its already implemented) 4. Add

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-06-22 Thread 9il via Digitalmars-d-announce
On Monday, 22 June 2020 at 12:04:13 UTC, 9il wrote: On Monday, 22 June 2020 at 10:53:02 UTC, Dukc wrote: On Sunday, 21 June 2020 at 15:24:14 UTC, 9il wrote: Can mir_parse handle other bases than decimal? No, only the decimal basis is supported for now. Support for hexadecimal FP/integer

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-06-22 Thread 9il via Digitalmars-d-announce
On Monday, 22 June 2020 at 10:53:02 UTC, Dukc wrote: On Sunday, 21 June 2020 at 15:24:14 UTC, 9il wrote: Can mir_parse handle other bases than decimal? No, only the decimal basis is supported for now. Support for hexadecimal FP/integer parsing can be added though. The basic stuff for

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-06-22 Thread Dukc via Digitalmars-d-announce
On Sunday, 21 June 2020 at 15:24:14 UTC, 9il wrote: Hey everyone, So excited to finally announce we can correctly parse floating-point numbers according to IEEE round half-to-even (bankers) rule like in C/C++, Rust, and others. Finally a worthy alternative to Vladimir Panteleevs parser [1].

Decimal string to floating point conversion with correct half-to-even rounding

2020-06-21 Thread 9il via Digitalmars-d-announce
Hey everyone, So excited to finally announce we can correctly parse floating-point numbers according to IEEE round half-to-even (bankers) rule like in C/C++, Rust, and others. @nogc, optionally nothrow API is provided as part of Mir Algorithm v3.9.0 [0]. The documentation is available [1].