Re: Minimum & Maximum

new topic     » goto parent     » topic index » view thread      » older message » newer message

function minimum(object a, object b)
    object c

    c = repeat(length(a), 0)
    for i = 1 to length(a) do
        if a[i] > b[i] then
            c[i] = b[i]
        else
            c[i] = a[i]
        end if
    end for
    return c
end function

I have no idea if this is faster (or works), but it seems less confusin,
and ain't recursive which cuts down on function call time.  Potential
prolems:  how fast is repeat?  and repeat also has a max, sumthin like
175,000.

Plus maximum just involves switchin the "<" to a ">", which is entirely
lazy enough to suit me. : )

snortboy

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu