Checking that floating points arguments are correct
问题 I want to write a class representing Markov chain (let's name it MC ). It has a constructor, which takes the state transition matrix (that is, vector<vector<double>> . I suppose, it is a good idea to check it is really a matrix (has the same number of rows and columns) and is really a transition matrix: all the numbers in it are probabilities, that is, no less than 0.0 and no greater than 1.0 , and for every row the sum of its elements is 1.0 . However, there is a problem which arises from