Is this returning the difference between node A and node B? if so you may consider changing return type to double, to ensure A: accuracy and B: no duplicate answers