Reading input files problem

Hi! I bougth a new Mac and I installed Xcode 10. I ran a c++ program which takes as input some .txt matrices but it can read only some of them. On my pc, which uses Xcode 8.1.0, and also on other computers with different operating systems, all the matrices are properly read. Is there something I have to change in the settings? The numers are read with double precision. The fact is that some of the matrices are read properly and other ones not, they are read as they are entirely formed by 0. In fact, they are mainly made by 0 but not entirely.

Replies

I have tried to define the 2D vectors that read the data files as a long double and not as a double and everything works properly! On the other two operating systems the double format could support such low numbers but on my new Mac I had to use the long double format.

That is the ideal solution. It is better to use a long double that can fully represent all of the data you have than to be using those "subnormal" doubles. The other operating systems should also work fine with a long double.