TemperatureCelsiusRange Method |
Returns a non-null low-to-high-sorted ICollection of
temperatures, with Celsius values running from
firstValue to lastValue (inclusive), and the
specified step between each consecutive temperature.
Namespace: DegreeDays.Api.DataAssembly: DegreeDays (in DegreeDays.dll) Version: 1.4
Syntax public static ICollection<Temperature> CelsiusRange(
double firstValue,
double lastValue,
double step
)
Public Shared Function CelsiusRange (
firstValue As Double,
lastValue As Double,
step As Double
) As ICollection(Of Temperature)
Parameters
- firstValue Double
- The Celsius value of the first Temperature to
be included in the returned ICollection. This must be
greater than or equal to -273°C and less than or equal to
3000°C.
- lastValue Double
- The Celsius value of the last Temperature to be
included in the returned ICollection. This must be
greater than or equal to firstValue. Also, like for
firstValue, it must be greater than or equal to
-273°C and less than or equal to 3000°C.
- step Double
- The Celsius temperature difference between each temperature
value to be included in the returned ICollection.
Cannot be NaN, and must be greater than zero. It must
also be a multiple of 0.1 (the smallest temperature
difference allowed), though allowances are made for floating-point
imprecision (so for example a step of
0.4999999 will be treated as 0.5).
Return Value
ICollectionTemperatureExceptions Exception | Condition |
---|
ArgumentOutOfRangeException | Any of the parameters are
NaN; firstValue or
lastValue are outside of their allowed range
(-273°C to 3000°C inclusive); lastValue
is less than firstValue; step is not
positive; or step is not a multiple of
0.1 (allowing for slight deviations caused by
floating-point imprecision). |
Remarks
For example, to get Celsius temperatures between 10°C and 30°C
(inclusive), with each temperature being 5°C greater than the last
(giving temperatures 10°C, 15°C, 20°C, 25°C, and
30°C):
ICollection<Temperature> temps = Temperature.CelsiusRange(10, 30, 5);
Dim temps As ICollection(Of Temperature) = Temperature.CelsiusRange(10, 30, 5)
Version History Version | Description |
---|
1.4 |
This was added in version 1.4.
|
See Also