Welcome

User: Pass:   register


The $and identifier will return the result from a bitwise "and".

Format

$and(<value1>,<value2>)

Parameters

  • <value1> One of the two values you want to do a bitwise and between.
  • <value2> The other value.

Properties

None.

Points To Note

The identifier doesn't take binary values as parameters, only decimal numbers.

Examples

//echo -a $and(4,1)

Output: 0

4 1 0 0
1 0 0 1
0 0 0 0


//echo -a $and(4,7)

Output: 4

4 1 0 0
7 1 1 1
4 1 0 0


//echo -a $and(9,11)

Output: 9

9 1 0 0 1
11 1 0 1 1
9 1 0 0 1

Hacks

You can combine $and and $not to make "nand".

$not($and(4,7))

You can leave the first parameter of $and empty and use an identifier in the second parameter to force the identifier to evaluate but not return a value. This is useful for $regex and $com

//echo -a $and(,$regex(abc,/a(.)c/)) * $regml(1)

Related Articles

None.

Related Commands

None.

Related Events

None.

Related Identifiers

$not $or $xor $base $biton $bitoff $isbit

Text and Number Identifiers
$abs$acos$and$asc$asin$atan$base$biton$bitoff$bytes$calc$ceil$chr$compress$cos$count$decode$decompress$encode$floor$int$isbit$islower$isupper$left$len$log$longip$lower$mid$noqt$not$or$ord$pos$poscs$qt$rand$remove$removecs$replace$replacecs$replacex$replacexcs$right$round$sin$sqrt$str$strip$stripped$tan$upper$wrap$xor






© 1996-2010 hdesk.org and dalnethelpdesk.com