Skip to main content

MLAPI.Serialization.Arithmetic

Arithmetic helper class

Inheritance#

System.Dynamic.ExpandoObject

System.Dynamic.ExpandoObject

Inherited Members#

Object.Equals(Object)

Object.Equals(Object, Object)

Object.GetHashCode()

Object.GetType()

Object.MemberwiseClone()

Object.ReferenceEquals(Object, Object)

Object.ToString()

Namespace: System.Dynamic.ExpandoObject#
Assembly: MLAPI.dll#
Syntax#
public static class Arithmetic

Methods#

VarIntSize(UInt64)#

Gets the output size in bytes after VarInting a unsigned integer

Declaration#

public static int VarIntSize(ulong value)

Parameters#

TypeNameDescription
System.UInt64valueThe unsigned integer whose length to get

Returns#

TypeDescription
System.Int32The amount of bytes

ZigZagDecode(UInt64)#

Decides a ZigZag encoded integer back to a signed integer

Declaration#

public static long ZigZagDecode(ulong value)

Parameters#

TypeNameDescription
System.UInt64valueThe unsigned integer

Returns#

TypeDescription
System.Int64The signed version of the integer

ZigZagEncode(Int64)#

ZigZag encodes a signed integer and maps it to a unsigned integer

Declaration#

public static ulong ZigZagEncode(long value)

Parameters#

TypeNameDescription
System.Int64valueThe signed integer to encode

Returns#

TypeDescription
System.UInt64A ZigZag encoded version of the integer