C++

fscanf problems with double

Trying to get input from the FILE* stream with image processing filter.   Example One:   Sample input (.txt)

Code snippet for scanning the double

Setting breakpoint in visual studio 2017, the filter.m returns set of values as the following

Which the first value, 0.7, wrongly being scanned as 0.69999999999999996.   Example Two:   Sample input (.txt)

Continue Reading