OsMax

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Add a example)
m (Small changes)
Line 5: Line 5:
 
|delay=0
 
|delay=0
 
|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
 
 
|ossl_example=<source lang="lsl">
 
|ossl_example=<source lang="lsl">
 +
//
 +
// osMax Script Exemple
 +
// Author: djphil
 +
//
 +
 
default
 
default
 
{
 
{
 
     state_entry()
 
     state_entry()
 
     {
 
     {
         llSay(PUBLIC_CHANNEL, "Script running");
+
         llSay(PUBLIC_CHANNEL, "Touch to see osMax usage.");
 
     }
 
     }
  
Line 20: Line 24:
 
         llSay(PUBLIC_CHANNEL, "\nThe larger value between " + (string)a + " and " + (string)b + " is " + (string)osMax(a, b));
 
         llSay(PUBLIC_CHANNEL, "\nThe larger value between " + (string)a + " and " + (string)b + " is " + (string)osMax(a, b));
 
     }
 
     }
}</source>
+
}
 +
|additional_info=This function was added in 0.7.4-post-fixes
 +
</source>
 
}}
 
}}
 
 
== See Also ==
 
== See Also ==
 
* [[osMin]]
 
* [[osMin]]
 +
* [[osMaxn]]

Revision as of 15:32, 5 December 2020

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)
//
// osMax Script Exemple
// Author: djphil
//
 
default
{
    state_entry()
    {
        llSay(PUBLIC_CHANNEL, "Touch to see osMax usage.");
    }
 
    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));
    }
}
|additional_info=This function was added in 0.7.4-post-fixes


See Also

Personal tools
General
About This Wiki