Search Results for

    Show / Hide Table of Contents

    Class DoubleExtensions

    Inheritance
    Object
    DoubleExtensions
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: System
    Assembly: Acoustics.Shared.dll
    Syntax
    public static class DoubleExtensions

    Methods

    | Improve this Doc View Source

    Floor(Double)

    Declaration
    public static double Floor(this double d)
    Parameters
    Type Name Description
    Double d
    Returns
    Type Description
    Double
    | Improve this Doc View Source

    Round(Double, MidpointRounding)

    Declaration
    public static double Round(this double d, MidpointRounding rounding = MidpointRounding.AwayFromZero)
    Parameters
    Type Name Description
    Double d
    MidpointRounding rounding
    Returns
    Type Description
    Double
    | Improve this Doc View Source

    RoundToSignificantDigits(Double, Int32)

    Round a number to digits significant places.

    Declaration
    public static double RoundToSignificantDigits(this double d, int digits)
    Parameters
    Type Name Description
    Double d

    The value to round.

    Int32 digits

    The number of significant digits to keep.

    Returns
    Type Description
    Double

    The rounded value.

    Remarks

    Sourced from: http://stackoverflow.com/questions/374316/round-a-double-to-x-significant-figures.

    | Improve this Doc View Source

    ScaleUnitToByte(Double)

    Scales a unit double value, that is in the interval [0.0, 1.0] to a byte [0, 255] value between 0 and 255, clamping out of bound values and rounding away from zero.

    Declaration
    public static byte ScaleUnitToByte(this double value)
    Parameters
    Type Name Description
    Double value

    The value.

    Returns
    Type Description
    Byte

    The clamped and rounded value.

    | Improve this Doc View Source

    Seconds(Double)

    Declaration
    public static TimeSpan Seconds(this double seconds)
    Parameters
    Type Name Description
    Double seconds
    Returns
    Type Description
    TimeSpan
    | Improve this Doc View Source

    Seconds(Int32)

    Declaration
    public static TimeSpan Seconds(this int seconds)
    Parameters
    Type Name Description
    Int32 seconds
    Returns
    Type Description
    TimeSpan
    | Improve this Doc View Source

    Seconds(Int64)

    Declaration
    public static TimeSpan Seconds(this long seconds)
    Parameters
    Type Name Description
    Int64 seconds
    Returns
    Type Description
    TimeSpan
    • Improve this Doc
    • View Source
    In This Article
    Generated by DocFX AP docs version: 21.7.0.4-master-e26127a50d7bd7472d47288f10e61014fb981f7f-DIRTY-CI:144 Back to top