to

Converts x to the specified integral type rounded if necessary by mode

  1. T to(D x, RoundingMode mode)
    @IEEECompliant("convertToIntegerTiesToAway", 22)
    @IEEECompliant("convertToIntegerTiesToEven", 22)
    @IEEECompliant("convertToIntegerTowardNegative", 22)
    @IEEECompliant("convertToIntegerTowardPositive", 22)
    @IEEECompliant("convertToIntegerTowardZero", 22)
    T
    to
    (
    T
    D
    )
    (
    auto const ref D x
    ,)
    if (
    isIntegral!T &&
    )
  2. F to(D x, RoundingMode mode)

Throws

InvalidOperationException if x is NaN, UnderflowException, OverflowException

Special values

xto!T(x)
NaN0
+∞T.max
-∞T.min
±0.00

Meta