Skip to content
This repository has been archived by the owner on May 9, 2018. It is now read-only.

Added more boolean expressions. #30

Merged
merged 1 commit into from
Nov 12, 2017
Merged

Added more boolean expressions. #30

merged 1 commit into from
Nov 12, 2017

Conversation

armcburney
Copy link
Member

@armcburney armcburney commented Nov 11, 2017

#3, #26

Changes

  • ^^
  • <
  • >
  • <=
  • >=

Usage

Adds ^^, <, >, <=, and >= operators

// Declare boolean refrences
const a = new cgl.Reference(
  new cgl.InterfaceVariable(cgl.Qualifier.In, new cgl.Variable(cgl.Type.Bool, 'a'))
);
const b = new cgl.Reference(
  new cgl.InterfaceVariable(cgl.Qualifier.In, new cgl.Variable(cgl.Type.Bool, 'b'))
);

// XOR expression
// (a ^^ b)
new cgl.XorExpression(a, b);

// Less than expression
// (a < b)
new cgl.LessThanExpression(a, b);

// Less than equal expression
// (a <= b)
new cgl.LessThanEqualExpression(a, b);

// Greater than expression
// (a > b)
new cgl.GreaterThanExpression(a, b);

// Greater than equal expression
// (a >= b)
new cgl.GreaterThanEqualExpression(a, b);

@davepagurek
Copy link
Member

TIL ^^ is logical XOR and that there's more than just ^ for bitwise XOR

@armcburney armcburney merged commit fddfa7e into master Nov 12, 2017
@armcburney armcburney deleted the other_operators branch November 12, 2017 00:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants