From WikiChip
Difference between revisions of "mirc/identifiers/$floor"
< mirc‎ | identifiers

m (Bot: Adding a template (template:mIRC identifier list))
(Parameters)
 
(9 intermediate revisions by 4 users not shown)
Line 1: Line 1:
The '''$floor''' identifier will calculate and return a numerical value rounded to the next lowest integer.
+
{{mirc title|$floor Identifier}}The '''$floor''' identifier will calculate and return a numerical value rounded to the next lowest integer.
 +
 
  
 
== Synopsis ==
 
== Synopsis ==
Line 5: Line 6:
  
 
== Parameters ==
 
== Parameters ==
{{ArgsList
+
* '''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.
+
 
}}
+
You can use the letter 'e' or 'd' as *10^N, $floor(5e6) = $floor($calc(5*10^6))
 +
 
 +
'''Note''': $floor(N) is the same as $int(N) 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 ==
Added: mIRC v6.1
+
{{mIRC compatibility|6.1}}
 
 
Added On: 29/08/2003
 
  
 
== See Also ==
 
== See Also ==
* [[$abs identifier - mIRC|$abs]]
+
* {{mIRC|$abs}}
* [[$acos identifier - mIRC|$acos]]
+
* {{mIRC|$ceil}}
* [[$asin identifier - mIRC|$asin]]
+
* {{mIRC|$int}}
* [[$atan identifier - mIRC|$atan]]
+
* {{mIRC|$round}}
* [[$base identifier - mIRC|$base]]
+
* {{mIRC|$calc}}
* [[$calc identifier - mIRC|$calc]]
 
* [[$ceil identifier - mIRC|$ceil]]
 
* [[$cos identifier - mIRC|$cos]]
 
* [[$sin identifier - mIRC|$sin]]
 
* [[$tan identifier - mIRC|$tan]]
 
{{mIRC identifier list}}
 
 
 
[[Category:MIRC identifiers]]
 

Latest revision as of 19:40, 13 August 2018

The $floor identifier will calculate and return a numerical value rounded to the next lowest integer.


Synopsis[edit]

$floor(N)

Parameters[edit]

  • N - The number to be rounded down. Decimals cause the value to round down, while integers are returned the same.

You can use the letter 'e' or 'd' as *10^N, $floor(5e6) = $floor($calc(5*10^6))

Note: $floor(N) is the same as $int(N) for N >= 0.

Example[edit]

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[edit]

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.


See Also[edit]