Merge remote-tracking branch 'origin/math-roundupdown' into clipping-2.5d-kring
This commit is contained in:
commit
2d86c1d559
|
|
@ -11,6 +11,7 @@
|
|||
- Added `Future<T>::isReady`.
|
||||
- Added `Future<T>::share`, which returns a `SharedFuture<T>` and allows multiple continuations to be attached.
|
||||
- Added `Rectangle::computeUnion`.
|
||||
- Added `Math::roundUp` and `Math::roundDown`.
|
||||
|
||||
### v0.6.0 - 2021-08-02
|
||||
|
||||
|
|
|
|||
|
|
@ -50,3 +50,23 @@ TEST_CASE("Math::convertLongitudeRange example") {
|
|||
//! [convertLongitudeRange]
|
||||
CHECK(longitude == CesiumUtility::Math::degreesToRadians(-90.0));
|
||||
}
|
||||
|
||||
TEST_CASE("Math::roundUp and roundDown") {
|
||||
CHECK(Math::roundUp(1.0, 0.01) == 1.0);
|
||||
CHECK(Math::roundDown(1.0, 0.01) == 1.0);
|
||||
|
||||
CHECK(Math::roundUp(1.01, 0.01) == 2.0);
|
||||
CHECK(Math::roundDown(1.99, 0.01) == 1.0);
|
||||
|
||||
CHECK(Math::roundUp(1.005, 0.01) == 1.0);
|
||||
CHECK(Math::roundDown(1.995, 0.01) == 2.0);
|
||||
|
||||
CHECK(Math::roundUp(-1.0, 0.01) == -1.0);
|
||||
CHECK(Math::roundDown(-1.0, 0.01) == -1.0);
|
||||
|
||||
CHECK(Math::roundUp(-1.99, 0.01) == -1.0);
|
||||
CHECK(Math::roundDown(-1.01, 0.01) == -2.0);
|
||||
|
||||
CHECK(Math::roundUp(-1.995, 0.01) == -2.0);
|
||||
CHECK(Math::roundDown(-1.005, 0.01) == -1.0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue