Re: Absolute

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

On Mon, 12 Jun 2000 09:39:32 -0400, Carl R. White <cyrek at BIGFOOT.COM> wrote:


>The 'sequence-magic' abs() function is:
>
>function abs(object x)
>    -- The bit in the outer brackets is normally in the function "sgn()"
>    return x * ( (x>0)-(x<0) )
>end function
Or you could use something I saw a while ago...

function abs(atom x)
    return sqrt(x * x)
end function

I always use it, and it's served me well

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

Search



Quick Links

User menu

Not signed in.

Misc Menu