Skip to content

Commit 5cce146

Browse files
committed
Merge branch 'master' of github.com:mpusz/units
2 parents 76a7692 + b76b903 commit 5cce146

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/systems/include/mp-units/systems/astronomy.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ namespace mp_units::astronomy {
4040
// clang-format off
4141
// time
4242
inline constexpr struct day final : named_unit<"D", non_si::day> {} day;
43-
inline constexpr struct sidereal_day final : named_unit<"D_sid", mag_ratio<86'164'0905, 1'000'000> * si::second> {} sidereal_day;
44-
inline constexpr struct Julian_year final : named_unit<"a", mag_ratio<365'25, 100> * day> {} Julian_year;
45-
inline constexpr struct tropical_year final : named_unit<"a_trop", mag_ratio<365'242189, 1'000'000> * day> {} tropical_year;
43+
inline constexpr struct sidereal_day final : named_unit<"D_sid", mag_ratio<861'640'905, 10'000> * si::second> {} sidereal_day;
44+
inline constexpr struct Julian_year final : named_unit<"a", mag_ratio<36'525, 100> * day> {} Julian_year;
45+
inline constexpr struct tropical_year final : named_unit<"a_trop", mag_ratio<365'242'189, 1'000'000> * day> {} tropical_year;
4646
inline constexpr struct century final : named_unit<"c", mag<100> * Julian_year> {} century;
4747
inline constexpr struct millennium final : named_unit<"ka", mag<1000> * Julian_year> {} millennium;
4848

test/static/astronomy_test.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ using namespace mp_units::si::unit_symbols;
3232
using mp_units::astronomy::unit_symbols::a;
3333

3434
// time units
35-
static_assert(1. * D == 86'400. * s);
36-
static_assert(approx_equal(1. * D_sid, (86'164'0905. / 1'000'000.) * s));
37-
static_assert(approx_equal(1. * a, 365.25 * D));
38-
static_assert(approx_equal(1. * a, 31'557'600. * s));
35+
static_assert(1 * D == 86'400 * s);
36+
static_assert(10'000 * D_sid == 861'640'905 * s);
37+
static_assert(100 * a == 36525 * D);
38+
static_assert(1 * a == 31'557'600 * s);
3939
static_assert(approx_equal(1. * a_trop, 365.242189 * D));
40-
static_assert(1. * c == 100. * a);
41-
static_assert(1. * ka == 1000. * a);
40+
static_assert(1 * c == 100 * a);
41+
static_assert(1 * ka == 1000 * a);
4242

4343
// length units
44-
static_assert(1. * LD == 384'399. * km);
45-
static_assert(1. * ly == 9'460'730'472'580'800. * m);
44+
static_assert(1 * LD == 384'399 * km);
45+
static_assert(1 * ly == 9'460'730'472'580'800 * m);
4646

4747
// spectral flux density
4848
static_assert(approx_equal(1. * Jy, 1e-26 * W / m2 / Hz));

0 commit comments

Comments
 (0)