Skip to content

Commit

Permalink
[wpiunits] Clarify return conditions for isEquivalent (NFC) (#6727)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold856 authored Jun 9, 2024
1 parent a087544 commit ae6954c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wpiunits/src/main/java/edu/wpi/first/units/Measure.java
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ default boolean isNear(Measure<U> other, Measure<U> tolerance) {
* @return true if this measure is equivalent, false otherwise
*/
default boolean isEquivalent(Measure<?> other) {
// Check for disjoint units that aren't compatible
// Return false for disjoint units that aren't compatible
return this.unit().getBaseUnit().equals(other.unit().getBaseUnit())
&& Math.abs(baseUnitMagnitude() - other.baseUnitMagnitude()) <= EQUIVALENCE_THRESHOLD;
}
Expand Down

0 comments on commit ae6954c

Please sign in to comment.