docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Arithmetic

    Arithmetic helper class

    Inheritance
    object
    Arithmetic
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Netcode
    Assembly: Unity.Netcode.Runtime.dll
    Syntax
    public static class Arithmetic

    Methods

    VarIntSize(ulong)

    Gets the output size in bytes after VarInting a unsigned integer

    Declaration
    public static int VarIntSize(ulong value)
    Parameters
    Type Name Description
    ulong value

    The unsigned integer whose length to get

    Returns
    Type Description
    int

    The amount of bytes

    ZigZagDecode(ulong)

    Decides a ZigZag encoded integer back to a signed integer

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

    The unsigned integer

    Returns
    Type Description
    long

    The signed version of the integer

    ZigZagEncode(long)

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

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

    The signed integer to encode

    Returns
    Type Description
    ulong

    A ZigZag encoded version of the integer

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)