Reference · Logic

Logic

20 words. Sorted alphabetically.

->WORDSIZE
  • ( wordsize:integer )

Set binary operation wordsize (1–64). Default 64 = no masking.

!=
  • ( any any )

Push true if TOS does not equal NOS.

!EQUIV?
  • ( a:any b:any -- result:boolean )

Push true if NOS is not equivalent to TOS (negation of EQUIV?).

<
  • ( any any )

Push true if NOS < TOS.

<=
  • ( any any )

Push true if NOS <= TOS.

==
  • ( any any )

Push true if TOS equals NOS.

>
  • ( any any )

Push true if NOS > TOS.

>=
  • ( any any )

Push true if NOS >= TOS.

AND
  • ( a:boolean b:boolean -- result:boolean )
  • ( a:integer b:integer -- result:integer )
  • ( symbolic symbolic )

Boolean AND (two booleans) or bitwise AND (two integers), masked to current wordsize.

EQUIV?
  • ( a:any b:any -- result:boolean )

Push true if NOS is equivalent to TOS (relaxed cross-type comparison via Object::equivalent).

IFTE
  • ( false-val:any true-val:any cond:boolean -- result:any )
  • ( symbolic symbolic symbolic )

Inline conditional: cond true-val false-val IFTE. Leaves the chosen value on the stack.

LSHIFT
  • ( value:integer shift:integer -- result:integer )
  • ( value:integer shift:number -- result:integer )

Logical left shift. value shift LSHIFT. Result masked to wordsize.

NEG
  • ( a:integer -- result:integer )
  • ( z:complex -- result:complex )
  • ( f:fraction -- neg:fraction )
  • ( hms -- hms )
  • ( dms -- dms )
  • ( symbolic )

Negate or bitwise-NOT — overloaded by type (integer: bitwise NOT masked to current wordsize; fraction: arithmetic negation).

NOT
  • ( a:boolean -- result:boolean )
  • ( symbolic )

Boolean NOT.

OR
  • ( a:boolean b:boolean -- result:boolean )
  • ( a:integer b:integer -- result:integer )
  • ( symbolic symbolic )

Boolean OR (two booleans) or bitwise OR (two integers), masked to current wordsize.

RLEFT
  • ( value:integer n:integer -- result:integer )
  • ( value:integer n:number -- result:integer )

Circular rotate left. value n RLEFT. Rotates within current wordsize.

RRIGHT
  • ( value:integer n:integer -- result:integer )
  • ( value:integer n:number -- result:integer )

Circular rotate right. value n RRIGHT. Rotates within current wordsize.

RSHIFT
  • ( value:integer shift:integer -- result:integer )
  • ( value:integer shift:number -- result:integer )

Logical right shift. value shift RSHIFT. Result masked to wordsize.

WORDSIZE->
  • ( -- wordsize:integer )

Push the current binary wordsize.

XOR
  • ( a:integer b:integer -- result:integer )

Bitwise XOR of two integers, masked to current wordsize.

Contact

Send us a message — we'll reply by email.