Int128.opCast

Support casting to floating point type

  1. bool opCast()
  2. T opCast()
  3. T opCast()
    struct Int128
    const
    T
    opCast
    (
    T : real
    )
    ()

Return Value

Type: T

value cast to floating point with environment-dependent rounding if the value is not exactly representable

Examples

const Int128 a = Int128(-1L << 60);
assert(cast(double) a == -(2.0 ^^ 60));
assert(cast(double) (a * a) == 2.0 ^^ 120);

Meta