fn: &&
[contents]

Contents

Syntax

The syntax for && calls is:

f++:  
&&(params)

n++:  
@&&(params)

Description

&& is the logical and operator, it takes a non-zero number of parameters, if any of the parameters evaluate to false then it returns 0, otherwise it returns 1.

Note: It is typically faster to use exprtk for logical operators, plus the syntax is nicer.

f++ example

Example of && being used with f++:

  1. int x=3, y=7
  2. if(&&(<(1, y), <(x, y))
  3. console("y is greater than both 1 and x")

n++ example

Examples of && being used with n++:

  1. @int x=3, y=7
  2. @if(&&(<(1, y), <(x, y))
  3. @console("y is greater than both 1 and x")

  1. @int x=3, y=7
  2. @console(@&&(<(1, y), <(x, y)))

  1. @int a=3, b=-2
  2.  
  3. @console("@&&(@>(a, 0), @>(b, 0))")
  4. @# expected output: 0