Function Epoch.tryFromDecimalYear

Construct a finite decimal-year epoch without throwing.

static bool tryFromDecimalYear(
  const T value,
  out Epoch!T result
) pure nothrow @nogc @safe;

Parameters

NameDescription
value Finite decimal year.
result Receives the epoch on success.

Returns

true for finite input; otherwise false. On entry result is reset to invalid .init.

Example

Example checking decimal-year construction without throwing.

import geodesy;
Epoch!double epoch;
assert(Epoch!double.tryFromDecimalYear(2010.0, epoch));
assert(epoch.decimalYear == 2010.0);