D float types operations vs C++ ones

drug via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Dec 17 03:50:02 PST 2015


I have two implementation of the same algorithm - D and C++ (that is 
port of D version). I assume that running these implementations on the 
same data should give the same results from both. But with some data the 
results differ (5th decimal digit after point). For my purpose it isn't 
important and I can ignore this difference. But I'd like to have the 
same results totally (I mean bit to bit) to easy maintanence of the 
implementations. Question is - can I rely that D and C++ float types 
operations should give the same result because D and C are similar or no 
and I should use more portable way and compare floats with some epsilon?


More information about the Digitalmars-d-learn mailing list