Table of Contents

Method DivRem

Namespace
Zyl.VectorTraits
Assembly
VectorTraits.dll

DivRem(int, int, out int)

Calculates the quotient of two 32-bit signed integers and also returns the remainder in an output parameter (计算两个 32 位有符号整数的商,并通过输出参数返回余数).

public static int DivRem(int a, int b, out int result)

Parameters

a int

The dividend (被除数).

b int

The divisor (除数).

result int

When this method returns, contains the remainder (当此方法返回时,包含余数).

Returns

int

The quotient of the specified numbers (指定数字的商).

Exceptions

DivideByZeroException

b is zero.

DivRem(long, long, out long)

Calculates the quotient of two 64-bit signed integers and also returns the remainder in an output parameter (计算两个 32 位有符号整数的商,并通过输出参数返回余数).

public static long DivRem(long a, long b, out long result)

Parameters

a long

The dividend (被除数).

b long

The divisor (除数).

result long

When this method returns, contains the remainder (当此方法返回时,包含余数).

Returns

long

The quotient of the specified numbers (指定数字的商).

Exceptions

DivideByZeroException

b is zero.

DivRem(sbyte, sbyte)

Produces the quotient and the remainder of two signed 8-bit numbers (生成两个 有符号8位数字 的商和余数).

[CLSCompliant(false)]
public static (sbyte Quotient, sbyte Remainder) DivRem(sbyte left, sbyte right)

Parameters

left sbyte

The dividend (被除数).

right sbyte

The divisor (除数).

Returns

(sbyte Quotient, sbyte Remainder)

The quotient and the remainder of the specified numbers (指定数字的商和余数).

DivRem(byte, byte)

Produces the quotient and the remainder of two unsigned 8-bit numbers (生成两个 无符号8位数字 的商和余数).

public static (byte Quotient, byte Remainder) DivRem(byte left, byte right)

Parameters

left byte

The dividend (被除数).

right byte

The divisor (除数).

Returns

(byte Quotient, byte Remainder)

The quotient and the remainder of the specified numbers (指定数字的商和余数).

DivRem(short, short)

Produces the quotient and the remainder of two signed 16-bit numbers (生成两个 有符号16位数字 的商和余数).

public static (short Quotient, short Remainder) DivRem(short left, short right)

Parameters

left short

The dividend (被除数).

right short

The divisor (除数).

Returns

(short Quotient, short Remainder)

The quotient and the remainder of the specified numbers (指定数字的商和余数).

DivRem(ushort, ushort)

Produces the quotient and the remainder of two unsigned 16-bit numbers (生成两个 无符号16位数字 的商和余数).

[CLSCompliant(false)]
public static (ushort Quotient, ushort Remainder) DivRem(ushort left, ushort right)

Parameters

left ushort

The dividend (被除数).

right ushort

The divisor (除数).

Returns

(ushort Quotient, ushort Remainder)

The quotient and the remainder of the specified numbers (指定数字的商和余数).

DivRem(int, int)

Produces the quotient and the remainder of two signed 32-bit numbers (生成两个 有符号32位数字 的商和余数).

public static (int Quotient, int Remainder) DivRem(int left, int right)

Parameters

left int

The dividend (被除数).

right int

The divisor (除数).

Returns

(int Quotient, int Remainder)

The quotient and the remainder of the specified numbers (指定数字的商和余数).

DivRem(uint, uint)

Produces the quotient and the remainder of two unsigned 32-bit numbers (生成两个 无符号32位数字 的商和余数).

[CLSCompliant(false)]
public static (uint Quotient, uint Remainder) DivRem(uint left, uint right)

Parameters

left uint

The dividend (被除数).

right uint

The divisor (除数).

Returns

(uint Quotient, uint Remainder)

The quotient and the remainder of the specified numbers (指定数字的商和余数).

DivRem(long, long)

Produces the quotient and the remainder of two signed 64-bit numbers (生成两个 有符号64位数字 的商和余数).

public static (long Quotient, long Remainder) DivRem(long left, long right)

Parameters

left long

The dividend (被除数).

right long

The divisor (除数).

Returns

(long Quotient, long Remainder)

The quotient and the remainder of the specified numbers (指定数字的商和余数).

DivRem(ulong, ulong)

Produces the quotient and the remainder of two unsigned 64-bit numbers (生成两个 无符号64位数字 的商和余数).

[CLSCompliant(false)]
public static (ulong Quotient, ulong Remainder) DivRem(ulong left, ulong right)

Parameters

left ulong

The dividend (被除数).

right ulong

The divisor (除数).

Returns

(ulong Quotient, ulong Remainder)

The quotient and the remainder of the specified numbers (指定数字的商和余数).