On Fri, Aug 15, 2014 at 04:51:59PM +, monarch_dodra via Digitalmars-d-learn
wrote:
> On Wednesday, 6 August 2014 at 18:07:08 UTC, H. S. Teoh via
> Digitalmars-d-learn wrote:
> >
> > import std.algorithm : reduce, max, min;
> >
> > auto highest = reduce!((a,b) => max(a,b))(-double.max,
On Wednesday, 6 August 2014 at 18:07:08 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
import std.algorithm : reduce, max, min;
auto highest = reduce!((a,b) => max(a,b))(-double.max,
bids.byValue());
auto lowest = reduce!((a,b) => min(a,b))(double.max,
bids.byValue());
T
Take a
TJB:
I am trying to find the max and min values in an associative
array. Say I have:
double[char] bids;
bid['A'] = 37.50;
bid['B'] = 38.11;
bid['C'] = 36.12;
How can I find the max and min values. I am thinking that I
need to use max and min functions from std.algorithm, but not
sure how to
Justin,
That's it! Perfect - thanks!!
TJB
Do you just need the min and max values or do you also need the
keys of
those values? If the former, here's a paste:
http://dpaste.dzfl.pl/0bbf31278a25
On Wednesday, 6 August 2014 at 17:57:55 UTC, TJB wrote:
I am trying to find the max and min values in an associative
array. Say I have:
double[char] bids;
bid['A'] = 37.50;
bid['B'] = 38.11;
bid['C'] = 36.12;
How can I find the max and min values. I am thinking that I
need to use max and min
On Wed, Aug 06, 2014 at 05:57:54PM +, TJB via Digitalmars-d-learn wrote:
> I am trying to find the max and min values in an associative array. Say I
> have:
>
> double[char] bids;
> bid['A'] = 37.50;
> bid['B'] = 38.11;
> bid['C'] = 36.12;
>
> How can I find the max and min values. I am think
On Wed, 06 Aug 2014 17:57:54 +, TJB wrote:
> I am trying to find the max and min values in an associative array. Say
> I have:
>
> double[char] bids;
> bid['A'] = 37.50;
> bid['B'] = 38.11;
> bid['C'] = 36.12;
>
> How can I find the max and min values. I am thinking that I need to use
> max
I am trying to find the max and min values in an associative
array. Say I have:
double[char] bids;
bid['A'] = 37.50;
bid['B'] = 38.11;
bid['C'] = 36.12;
How can I find the max and min values. I am thinking that I need
to use max and min functions from std.algorithm, but not sure how
to.
Tha