From WikiChip
$or identifier - mIRC
< mirc‎ | identifiers

$or returns the binary OR of 2 numbers.


Synopsis[edit]

$or(<N1>,<N2>)

Parameters[edit]

  • <N1>/<N2> - The numbers, in base10/decimal

Properties[edit]

None

Example[edit]

//echo -a $or(14,27)
; returns 31

Bits which are both 0 return 0, otherwise the bit is 1

//var %n1 14 | var %n2 27 | echo -a $base(%n1,10,2,8) | echo -a $base(%n2,10,2,8) | echo -a $str(-,8) | echo -a $base($or(%n1,%n2),10,2,8)

returns:

00001110
00011011
--------
00011111

$or returns the answer as a decimal number, so the answer 31 is the decimal representation of binary 11111.

Compatibility[edit]

Added: mIRC v5.61
Added on: 23 Sep 1999
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.


See also[edit]

[Expand]
v · d · e mIRC identifier list