Maximum of

angerangel edited this page Jan 4, 2013 · 1 revision

USAGE

   MAXIMUM-OF series /skip size

DESCRIPTION

Finds the largest value in a series

MAXIMUM-OF is a function value.

ARGUMENTS

  • series -- Series to search (series!)

REFINEMENTS

  • /skip -- Treat the series as records of fixed size
    • size (integer!)

#SOURCE

maximum-of: make function! [  [
    "Finds the largest value in a series"
    series [series!] "Series to search"
    /skip "Treat the series as records of fixed size"
    size [integer!]
    /local spot
][
    size: any [size 1]
    if 1 > size [cause-error 'script 'out-of-range size]
    spot: series
    forskip series size [
        if greater? first series first spot [spot: series]
    ]
    spot
] ]
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.