From WikiChip
Difference between revisions of "mirc/identifiers/$floor"
m |
Maroonbells (talk | contribs) m |
||
Line 9: | Line 9: | ||
| N | The number to be rounded down. Decimals cause the value to round down, while integers are returned the same. | | N | The number to be rounded down. Decimals cause the value to round down, while integers are returned the same. | ||
}} | }} | ||
+ | |||
+ | * Note: $floor() is the same as $int() only for N >= 0. | ||
== Example == | == Example == | ||
Echo to the active window '''9.318''' rounded to the next lowest integer: | Echo to the active window '''9.318''' rounded to the next lowest integer: | ||
− | <source lang="mIRC">//echo -a $floor(9.318)</source> | + | <source lang="mIRC">//echo -a $floor(9.318) |
+ | |||
+ | //var %a $pi | echo -a floor: $floor(%a) int: $int(%a) ceil: $ceil(%a) abs: $abs(%a) | ||
+ | result: floor: 3 int: 3 ceil: 4 abs: 3.141593 | ||
+ | //var %a -1.5 | echo -a floor: $floor(%a) int: $int(%a) ceil: $ceil(%a) abs: $abs(%a) | ||
+ | result: floor: -2 int: -1 ceil: -1 abs: 1.5 | ||
+ | </source> | ||
== Compatibility == | == Compatibility == | ||
Line 19: | Line 27: | ||
== See Also == | == See Also == | ||
* {{mIRC|$abs}} | * {{mIRC|$abs}} | ||
− | * {{mIRC|$ | + | * {{mIRC|$ceil}} |
− | * {{mIRC|$ | + | * {{mIRC|$int}} |
− | * {{mIRC|$ | + | * {{mIRC|$round}} |
− | |||
* {{mIRC|$calc}} | * {{mIRC|$calc}} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 03:16, 30 April 2018
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
The $floor identifier will calculate and return a numerical value rounded to the next lowest integer.
Synopsis
$floor(N)
Parameters
N The number to be rounded down. Decimals cause the value to round down, while integers are returned the same.
- Note: $floor() is the same as $int() only for N >= 0.
Example
Echo to the active window 9.318 rounded to the next lowest integer:
//echo -a $floor(9.318) //var %a $pi | echo -a floor: $floor(%a) int: $int(%a) ceil: $ceil(%a) abs: $abs(%a) result: floor: 3 int: 3 ceil: 4 abs: 3.141593 //var %a -1.5 | echo -a floor: $floor(%a) int: $int(%a) ceil: $ceil(%a) abs: $abs(%a) result: floor: -2 int: -1 ceil: -1 abs: 1.5
Compatibility
Added: mIRC v6.1
Added on: 29 Aug 2003
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.