Skip to content

Commit

Permalink
test: conditional compilation set for constexpr round() usage
Browse files Browse the repository at this point in the history
  • Loading branch information
mpusz committed Aug 25, 2023
1 parent c625be5 commit 636f1e1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/unit_test/static/iau_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ static_assert(isq::length(1 * LD) == 384'399 * si::kilo<si::metre>);
static_assert(isq::length(1 * ly) == 9'460'730'472'580'800 * si::metre);
static_assert(isq::length(10'000'000'000 * A) == 1 * si::metre);

#if __cpp_lib_constexpr_cmath || MP_UNITS_COMP_GCC
// TODO Should the below work for `1 * pc`? If yes, how to extent the type and how to convert it to a floating-point
// representation for comparison purposes?
static_assert(round<si::metre>(isq::length(1.L * pc)) == 30'856'775'814'913'673 * si::metre);
#endif

static_assert(isq::speed(1 * c_0) == 299'792'458 * (si::metre / si::second));

Expand Down

0 comments on commit 636f1e1

Please sign in to comment.