Show / Hide Table of Contents

    Class NumberUtilityExtensions

    This is an extension implementation of the most common methods on the NumberUtility class.

    Inheritance
    System.Object
    NumberUtilityExtensions
    Namespace: Cuemon
    Assembly: Cuemon.Core.dll
    Syntax
    public static class NumberUtilityExtensions

    Methods

    | Improve this Doc

    BytesToGigabytes(Int64)

    Converts the specified bytes to its equivalent representation in gigabytes.

    Declaration
    public static double BytesToGigabytes(this long bytes)
    Parameters
    Type Name Description
    System.Int64 bytes

    The bytes to be converted.

    Returns
    Type Description
    System.Double

    A gigabyte representation equivalent to the specified bytes.

    | Improve this Doc

    BytesToKilobytes(Int64)

    Converts the specified bytes to its equivalent representation in kilobytes.

    Declaration
    public static double BytesToKilobytes(this long bytes)
    Parameters
    Type Name Description
    System.Int64 bytes

    The bytes to be converted.

    Returns
    Type Description
    System.Double

    A kilobyte representation equivalent to the specified bytes.

    | Improve this Doc

    BytesToMegabytes(Int64)

    Converts the specified bytes to its equivalent representation in megabytes.

    Declaration
    public static double BytesToMegabytes(this long bytes)
    Parameters
    Type Name Description
    System.Int64 bytes

    The bytes to be converted.

    Returns
    Type Description
    System.Double

    A megabyte representation equivalent to the specified bytes.

    | Improve this Doc

    BytesToTerabytes(Int64)

    Converts the specified bytes to its equivalent representation in terabytes.

    Declaration
    public static double BytesToTerabytes(this long bytes)
    Parameters
    Type Name Description
    System.Int64 bytes

    The bytes to be converted.

    Returns
    Type Description
    System.Double

    A terabyte representation equivalent to the specified bytes.

    | Improve this Doc

    Factorial(Double)

    Calculates the factorial of a positive integer n denoted by n!.

    Declaration
    public static double Factorial(this double n)
    Parameters
    Type Name Description
    System.Double n

    The positive integer to calculate a factorial number by.

    Returns
    Type Description
    System.Double

    The factorial number calculated from n, or System.Double.PositiveInfinity if n is to high a value.

    | Improve this Doc

    IsCountableSequence(IEnumerable<Int32>)

    Determines whether the specified source is a sequence of countable integrals (hence, integrals being either incremented or decremented with the same cardinality through out the sequence).

    Declaration
    public static bool IsCountableSequence(this IEnumerable<int> source)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.Int32> source

    The value to test for a sequence of countable characters.

    Returns
    Type Description
    System.Boolean

    true if the specified source is a sequence of countable integrals (hence, integrals being either incremented or decremented with the same cardinality through out the sequence); otherwise, false.

    | Improve this Doc

    IsCountableSequence(IEnumerable<Int64>)

    Determines whether the specified source is a sequence of countable integrals (hence, integrals being either incremented or decremented with the same cardinality through out the sequence).

    Declaration
    public static bool IsCountableSequence(this IEnumerable<long> source)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.Int64> source

    The value to test for a sequence of countable characters.

    Returns
    Type Description
    System.Boolean

    true if the specified source is a sequence of countable integrals (hence, integrals being either incremented or decremented with the same cardinality through out the sequence); otherwise, false.

    | Improve this Doc

    IsEven(Int32)

    Determines whether the specified value is an even number.

    Declaration
    public static bool IsEven(this int value)
    Parameters
    Type Name Description
    System.Int32 value

    The value to evaluate.

    Returns
    Type Description
    System.Boolean

    true if the specified value is an even number; otherwise, false.

    | Improve this Doc

    IsOdd(Int32)

    Determines whether the specified value is an odd number.

    Declaration
    public static bool IsOdd(this int value)
    Parameters
    Type Name Description
    System.Int32 value

    The value to evaluate.

    Returns
    Type Description
    System.Boolean

    true if the specified value is an odd number; otherwise, false.

    | Improve this Doc

    IsPrime(Int32)

    Determines whether the specified value is a prime number.

    Declaration
    public static bool IsPrime(this int value)
    Parameters
    Type Name Description
    System.Int32 value

    The positive integer to determine whether is a prime number.

    Returns
    Type Description
    System.Boolean

    true if the specified value is a prime number; otherwise, false.

    Exceptions
    Type Condition
    System.ArgumentException

    value has a value smaller than 0.

    | Improve this Doc

    RoundOff(Double, RoundOffAccuracy)

    Rounds a double-precision floating-point value to the nearest integral value closest to the specified accuracy.

    Declaration
    public static double RoundOff(this double value, RoundOffAccuracy accuracy)
    Parameters
    Type Name Description
    System.Double value

    A double-precision floating-point number to be rounded.

    RoundOffAccuracy accuracy

    The accuracy to use in the rounding.

    Returns
    Type Description
    System.Double

    The integer value closest to the specified accuracy of value.
    Note that this method returns a System.Double instead of an integral type.

    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX