License
Boost License 1.0
Source: std/int128.d
Implements a signed 128 bit integer type.
Author: Walter Bright
Source: std/int128.d
128 bit signed integer type.
bool opEquals(long lo) constCompare for equality Params: lo = signed value to compare with Returns: true if Int128 equals valuebool opEquals(ulong lo) constCompare for equality Params: lo = unsigned value to compare with Returns: true if Int128 equals valuebool opEquals(Int128 op2) constCompare for equality Params: op2 = value to compare with Returns: true if Int128 equals valueInt128 opUnary(string op)() if (op == "+") constSupport unary arithmentic operator + Params: op = "+" Returns: lvalue of resultInt128 opUnary(string op)() if (op == "-" || op == "~") constSupport unary arithmentic operator - ~ Params: op = "-", "~" Returns: lvalue of resultInt128 opUnary(string op)() if (op == "++" || op == "--")Support unary arithmentic operator ++ -- Params: op = "++", "--" Returns: lvalue of resultbool opCast(T : bool)() constSupport casting to a bool Params: T = bool Returns: true if value is not zeroT opCast(T : long)() if (is(byte : T)) constSupport casting to an integral type Params: T = integral type Returns: low bits of value reinterpreted as TT opCast(T : real)() constSupport casting to floating point type Params: T = floating point type Returns: value cast to floating point with environment-dependent rounding if the value is not exactly representableInt128 opBinary(string op)(Int128 op2) if (op == "+" || op == "-" ||
op == "*" || op == "/" || op == "%" ||
op == "&" || op == "|" || op == "^") constSupport binary arithmetic operators + - * / % & | ^ << >> >>> Params: op = one of the arithmetic binary operators op2 = second operand Returns: value after the operation is appliedInt128 opBinary(string op, Int)(const Int op2) if ((op == "+" || op == "-" ||
op == "*" || op == "/" || op == "%" ||
op == "&" || op == "|" || op == "^") &&
is(Int : long) && __traits(isIntegral, Int)) constdittoInt128 opBinary(string op, IntLike)(auto ref IntLike op2) if ((op == "+" || op == "-" ||
op == "*" || op == "/" || op == "%" ||
op == "&" || op == "|" || op == "^") &&
is(IntLike : long) && !__traits(isIntegral, IntLike)) constdittoInt128 opBinaryRight(string op, Int)(const Int op2) if ((op == "+" || op == "-" ||
op == "*" || op == "/" || op == "%" ||
op == "&" || op == "|" || op == "^") &&
is(Int : long) && __traits(isIntegral, Int)) constdittoInt128 opBinaryRight(string op, IntLike)(auto ref IntLike op2) if ((op == "+" || op == "-" ||
op == "*" || op == "/" || op == "%" ||
op == "&" || op == "|" || op == "^") &&
is(IntLike : long) && !__traits(isIntegral, IntLike)) constdittoInt128 opOpAssign(string op)(Int128 op2) if (op == "+" || op == "-" ||
op == "*" || op == "/" || op == "%" ||
op == "&" || op == "|" || op == "^" ||
op == "<<" || op == ">>" || op == ">>>") refarithmetic assignment operators += -= *= /= %= &= |= ^= <<= >>= >>>= Params: op = one of +, -, etc. op2 = second operand Returns: lvalue of updated left operandInt128 opOpAssign(string op, Int)(auto ref Int op2) if ((op == "+" || op == "-" ||
op == "*" || op == "/" || op == "%" ||
op == "&" || op == "|" || op == "^" ||
op == "<<" || op == ">>" || op == ">>>")
&& is(Int : long)) refdittoint opCmp(Int128 op2) const @nogc nothrow pure @safesupport arithmentic comparison operators < <= > >= Params: op2 = right hand operand Returns: -1 for less than, 0 for equals, 1 for greater thanint opCmp(Int)(const Int op2) if (is(Int : long) && __traits(isIntegral, Int)) const @nogc nothrow pure @safedittoint opCmp(IntLike)(auto ref IntLike op2) if (is(IntLike : long) && !__traits(isIntegral, IntLike)) constdittovoid toString(Writer, FormatSpec)(scope ref Writer sink, scope const ref FormatSpec fmt) constFormats `Int128` with either `%d`, `%x`, `%X`, or `%s` (same as `%d`).