which conforms with the total moles provided by the call to State::new. In any case, this is only an issue, if the molefracs do not add up to 1. A different approach would be to return an Error if this condition is not met, however, I'm not much in favor of adding an == 1.0 check due to the implications on floating point arithmetic.
would previously evaluate to
with this change the output is
which conforms with the total moles provided by the call to
State::new
. In any case, this is only an issue, if the molefracs do not add up to 1. A different approach would be to return an Error if this condition is not met, however, I'm not much in favor of adding an == 1.0 check due to the implications on floating point arithmetic.