Click or drag to resize

TemperatureFahrenheitRange Method

Returns a non-null low-to-high-sorted ICollection of temperatures, with Fahrenheit values running from firstValue to lastValue (inclusive), and the specified step between each consecutive temperature.

Namespace: DegreeDays.Api.Data
Assembly: DegreeDays (in DegreeDays.dll) Version: 1.4
Syntax
public static ICollection<Temperature> FahrenheitRange(
	double firstValue,
	double lastValue,
	double step
)

Parameters

firstValue  Double
The Fahrenheit value of the first Temperature to be included in the returned ICollection. This must be greater than or equal to -459.4°F and less than or equal to 5432°F.
lastValue  Double
The Fahrenheit 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 -459.4°F and less than or equal to 5432°F.
step  Double
The Fahrenheit 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

ICollectionTemperature
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionAny of the parameters are NaN; firstValue or lastValue are outside of their allowed range (-459.4°F to 5432°F 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 Fahrenheit temperatures between 50°F and 70°F (inclusive), with each temperature being 5°F greater than the last (giving temperatures 50°F, 55°F, 60°F, 65°F, and 70°F):

ICollection<Temperature> temps = Temperature.FahrenheitRange(50, 70, 5);
Version History
VersionDescription
1.4 This was added in version 1.4.
See Also