"min" and "max"
pascal111
judas.the.messiah.111 at gmail.com
Wed Aug 10 00:03:37 UTC 2022
On Tuesday, 9 August 2022 at 23:56:53 UTC, Paul Backus wrote:
> On Tuesday, 9 August 2022 at 23:35:23 UTC, pascal111 wrote:
>> "min" and "max" in "std.algorithm" can be used with single
>> values to pick up the min and max values, but it didn't
>> mention how they can be used with ranges in the documentation:
>>
>> https://dlang.org/phobos/std_algorithm_comparison.html#.min
>
> The docs do mention `minElement` and `maxElement` (the range
> versions) under the "See Also" heading, but you're right that
> it's not super clear *why* they're mentioned.
They said " If at least one of the arguments is NaN, the result
is an unspecified value. See std.algorithm.searching.minElement
for examples on how to cope with NaNs.", as a beginner how can I
guess what "NaNs" means or if it refers to ranges?!
More information about the Digitalmars-d-learn
mailing list