I'm in the process of converting a program from Scilab code to C++ and it's essential for me to maintain the results produced by Scilab.
I'm aware that Scilab uses IEEE 754 double precision and that C++ doubles (although not required to) are implemented in a similar way.
Is it then a bad idea to use higher precision (e.g. long double
) in C++ if I'm trying to exactly match the results of Scilab?
For example: Is it possible for Scilab to calculate a number to be 0.1234 whereas in C++ using long doubles the number would be 0.12345. Thus potentially creating a variance that would result in the two programs producing different results (albeit more accurate in C++).