NeturalMath Language Definition and Syntax

Or Operator (|)

The Or Operator compares two values and yields the result. If the values are boolean in nature, it will perform a boolean Or operation. If the values are numeric, the resulting data will be an OR comparison of the bits.

Syntax

value | value

Data Types

Bool

Logic Table
right
left false true
false false true
true true true

The Boolean Or operation returns true if either one of the values is true. If will only return false if BOTH values are false. This has the same net result as the Add Operator for bools.
:> print true | true

true
:> print true | false

true
:> print false | false

false
:> print false | true

true

Complex

This section is not implemented

Number

Numbers evaluated and a bitwise OR comparison is returned. This has the effect of comparing the bits and returning a new value based on where either bit is set to 1.
:> print 10 | 2

10
:> print 1234 | 3

1235

Range

This section is not implemented

Set

This section is not implemented

String

The or operator will evaluate the characters which are found in both strings and return them. It will return the maximum number of instances found in both strings if the character exists in both values.
:> print 'Netural' | 'Math'

'NeturalMh'
:> print 'Microsoft' & 'Google'

'MicrosoftGgle'

Unit

This section is not implemented

See Also

Data Types
Arithmatic Operators

Last edited Oct 20, 2010 at 2:49 PM by zanethorn, version 1

Comments

No comments yet.