docs.unity3d.com
    Show / Hide Table of Contents

    Class Arithmetic

    Arithmetic helper class

    Inheritance
    Object
    Arithmetic
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Netcode
    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
    Type Name Description
    UInt64 value

    The unsigned integer whose length to get

    Returns
    Type Description
    Int32

    The amount of bytes

    ZigZagDecode(UInt64)

    Decides a ZigZag encoded integer back to a signed integer

    Declaration
    public static long ZigZagDecode(ulong value)
    Parameters
    Type Name Description
    UInt64 value

    The unsigned integer

    Returns
    Type Description
    Int64

    The 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
    Type Name Description
    Int64 value

    The signed integer to encode

    Returns
    Type Description
    UInt64

    A ZigZag encoded version of the integer

    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on 26 October 2023