Maximum value in a list - Hewlett Packard

This is a discussion on Maximum value in a list - Hewlett Packard ; Hi guys, i would like to know how to get the max value in a list. i have tryed making the list and then pressing MAX but that doesnt work. for example: {5 2 69 189 2 3 489} and ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Maximum value in a list

  1. Maximum value in a list

    Hi guys, i would like to know how to get the max value in a list. i
    have
    tryed making the list and then pressing MAX but that doesnt work.
    for example:
    {5 2 69 189 2 3 489} and i would like to get the 489.

    Thank you in advance.

  2. Re: Maximum value in a list

    > {5 2 69 189 2 3 489} and i would like to get the 489.
    >
    > Thank you in advance.


    The designers of the 48 were really sneaky. They have built things in
    to do about anything you can imagine, in this case you'll want to use
    the STREAM command

    { 5 2 69 489 2 3 189 }
    << MAX >>
    STREAM

    TW


  3. Re: Maximum value in a list

    On 30 jun, 21:52, TW wrote:
    > > {5 2 69 189 2 3 489} and i would like to get the 489.

    >
    > > Thank you in advance.

    >
    > The designers of the 48 were really sneaky. *They have built things in
    > to do about anything you can imagine, in this case you'll want to use
    > the STREAM command
    >
    > { 5 2 69 489 2 3 189 }
    > << MAX >>
    > STREAM
    >
    > TW


    hehe thank you brother, really fast answer, one more thing, whats the
    stream command for?

  4. Re: Maximum value in a list

    On Jun 30, 7:00*pm, alpuy2...@gmail.com wrote:
    > On 30 jun, 21:52, TW wrote:
    >
    > > > {5 2 69 189 2 3 489} and i would like to get the 489.

    >
    > > > Thank you in advance.

    >
    > > The designers of the 48 were really sneaky. *They have built things in
    > > to do about anything you can imagine, in this case you'll want to use
    > > the STREAM command

    >
    > > { 5 2 69 489 2 3 189 }
    > > << MAX >>
    > > STREAM

    >
    > > TW

    >
    > hehe thank you brother, really fast answer, one more thing, whats the
    > stream command for?


    From page 294 of the Advanced Users Reference:

    "Stream Execution Command: Moves the first two elements from the list
    onto the stack, and
    executes obj. Then moves the next element (if any) onto the stack, and
    executes obj again using
    the previous result and the new element. Repeats this until the list
    is exhausted, and returns the
    final result.

    STREAM is nominally designed for obj to be a program or command that
    requires two
    arguments and returns one result.

    See also DOSUBS"

    TW

  5. Re: Maximum value in a list

    On Jul 1, 1:46*am, alpuy2...@gmail.com wrote:
    > Hi guys, i would like to know how to get the max value in a list. i
    > have
    > tryed making the list and then pressing MAX but that doesnt work.
    > for example:
    > {5 2 69 189 2 3 489} and i would like to get the 489.
    >
    > Thank you in advance.


    Tim's answer is good. Using some other commands you could do << SORT
    DUP SIZE GET >>

    Arnaud

  6. Re: Maximum value in a list

    Not much difference with a very short list,
    but for a long list,
    one pass thru the list with MAX
    should be much faster than doing a complete SORT.

    [r->] [OFF]

  7. Re: Maximum value in a list

    On 1 jul, 16:13, "John H Meyers" wrote:
    > Not much difference with a very short list,
    > but for a long list,
    > one pass thru the list with MAX
    > should be much faster than doing a complete SORT.
    >
    > [r->] [OFF]


    Thank you guys, it was really usefull i needed it for non parametric
    statistical tests.

+ Reply to Thread