You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should be able to convert between the various quantities and back without losing any precision. For example:
@Test
funsmall_length_to_velocity_and_reverse_is_lossless() {
val distance =100.kilometers
val duration =1.hours
val velocity = distance / duration
assertEquals(duration, distance / velocity)
assertEquals(distance, velocity * duration)
}
Right now this test fails with the following message, and it's because we're losing precision.
java.lang.AssertionError: expected:<1h> but was:<1h 0m 0.000000100s>
at org.junit.Assert.fail(Assert.java:89)
at org.junit.Assert.failNotEquals(Assert.java:835)
at org.junit.Assert.assertEquals(Assert.java:120)
We should have integration tests that exercise the following without losing precision:
Acceleration, Mass, and Force
Acceleration * Mass -> Force -> Force / Mass -> Acceleration
Acceleration * Mass -> Force -> Force / Acceleration -> Mass
We should be able to convert between the various quantities and back without losing any precision. For example:
Right now this test fails with the following message, and it's because we're losing precision.
We should have integration tests that exercise the following without losing precision:
Acceleration, Mass, and Force
Acceleration, Duration, and Velocity
Area and Length
Energy, Length, and Force
Energy, Duration, and Power
Length, Duration, and Velocity
Length, Area, and Volume
The text was updated successfully, but these errors were encountered: