good reasons not to use D?

Ilya Yaroshenko via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Nov 5 08:22:49 PST 2015


On Monday, 2 November 2015 at 17:07:33 UTC, Laeeth Isharc wrote:
> On Sunday, 1 November 2015 at 09:07:56 UTC, Ilya Yaroshenko 
> wrote:
>> On Friday, 30 October 2015 at 10:35:03 UTC, Laeeth Isharc 
>> wrote:
>>> Any other thoughts?
>>
>> Floating point operations can be extended automatically 
>> (without some kind of 'fastmath' flag) up to 80bit fp on 32 
>> bit intel processors. This is worst solution for language that 
>> want to be used in accounting or math.
>>
>> Thoughts like "larger precision entails more accurate answer" 
>> are naive and wrong.
>>
>> --Ilya
>
> Thanks, Ilya.  An important but subtle point.  Funnily enough, 
> I haven't done so much specifically heavily numerical work so 
> far, but trust that in the medium term the dlangscience project 
> by John Colvin and others will bear fruit.
>
> What would you suggest is a better option to address the 
> concerns you raised?

The main goal is that we need to rewrite std.math & 
std.mathspecial to
1. Support all FP types (float/double)
2. Be portable (no Assembler when possible!, we _can_ use CEPHES 
code)
3. Produce equal results on different machines with different 
compilers for float/double.

The problem is that many math functions use compensatory hacks to 
make result more accurate. But this hack have _very_ bad 
behaviour if we allow 80bit math for double and float.

Q: What we need to change?
A: Only dmd backend for old intel/amd 32 bit processors without 
sse support. Other compilers and platforms are not affected. So, 
D will have the same FP behaviour like C.

See also the comment: 
https://github.com/D-Programming-Language/phobos/pull/2991#issuecomment-74506203

-- Ilya


More information about the Digitalmars-d-learn mailing list