Class DoubleExtensions
Inheritance
DoubleExtensions
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
|
Improve this Doc
View Source
Round(Double, MidpointRounding)
Declaration
public static double Round(this double d, MidpointRounding rounding = MidpointRounding.AwayFromZero)
Parameters
Returns
|
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.
|
|
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
|
Improve this Doc
View Source
Seconds(Int32)
Declaration
public static TimeSpan Seconds(this int seconds)
Parameters
Type |
Name |
Description |
Int32 |
seconds |
|
Returns
|
Improve this Doc
View Source
Seconds(Int64)
Declaration
public static TimeSpan Seconds(this long seconds)
Parameters
Type |
Name |
Description |
Int64 |
seconds |
|
Returns