OsMax: Difference between revisions

From OpenSimulator
Jump to navigationJump to search
imported>Ubit
No edit summary
imported>Djphil
Add a example
Line 6: Line 6:
|description=Returns the larger of two numbers. Wraps to system Math.Max()
|description=Returns the larger of two numbers. Wraps to system Math.Max()
|additional_info=This function was added in 0.7.4-post-fixes
|additional_info=This function was added in 0.7.4-post-fixes
|ossl_example=<source lang="lsl">
default
{
    state_entry()
    {
        llSay(PUBLIC_CHANNEL, "Script running");
    }
    touch_start(integer number)
    {
        float a = llFrand(10.0);
        float b = llFrand(10.0);
        llSay(PUBLIC_CHANNEL, "\nThe larger value between " + (string)a + " and " + (string)b + " is " + (string)osMax(a, b));
    }
}</source>
}}
}}


== See Also ==
== See Also ==
* [[osMin]]
* [[osMin]]

Revision as of 15:51, 15 August 2019

float osMax(float a, float b)
Returns the larger of two numbers. Wraps to system Math.Max()
Threat Level This function does not do a threat level check
Permissions Use of this function is always allowed by default
Extra Delay 0 seconds
Example(s)
default
{
    state_entry()
    {
        llSay(PUBLIC_CHANNEL, "Script running");
    }

    touch_start(integer number)
    {
        float a = llFrand(10.0);
        float b = llFrand(10.0);
        llSay(PUBLIC_CHANNEL, "\nThe larger value between " + (string)a + " and " + (string)b + " is " + (string)osMax(a, b));
    }
}
Notes
This function was added in 0.7.4-post-fixes



See Also