In Fortran, I output the result of tanh(1) and I get the value 0.7615941763:
open(unit=2, file='test_digits.txt', ACTION="write") write(2, '(1000F14.10)')( real(tanh(1.0))) However, I now try to do the same in MatLAB and the output is 0.761594155955765. There is a difference at the 8th digit.
What is the reason for this precision-difference? Can I fix it somehow?