View Source Orb.Numeric.DSL (Orb v0.1.1)

Operators that work with all number types.

Summary

Functions

Bitwise AND operation for i32 or i64 integers.

Left shift operation for i32 or i64 integers.

Logical AND operation for i32 or i64 integers. Returns i32.

Logical NOT operation for i32 or i64 integers. Returns i32.

Logical OR operation for i32 or i64 integers. Returns i32.

Bitwise OR operation for i32 or i64 integers.

Functions

Bitwise AND operation for i32 or i64 integers.

Examples

use Orb

defw bitwise_and_example(a: I32, b: I32), I32 do
  a &&& b
end

Left shift operation for i32 or i64 integers.

Examples

use Orb

defw left_shift_by_4(a: I32), I32 do
  a <<< 4
end

Logical AND operation for i32 or i64 integers. Returns i32.

Zero is considered false, all other numbers are considered true.

It does not support short-circuiting.

Examples

use Orb

defw and_example(a: I32, b: I32), I32 do
  a and b
end

Logical NOT operation for i32 or i64 integers. Returns i32.

Zero is considered false, all other numbers are considered true.

It does not support short-circuiting.

Examples

use Orb

defw not_example(a: I32), I32 do
  not a
end

Logical OR operation for i32 or i64 integers. Returns i32.

Zero is considered false, all other numbers are considered true.

It does not support short-circuiting.

Examples

use Orb

defw or_example(a: I32, b: I32), I32 do
  a or b
end

Bitwise OR operation for i32 or i64 integers.

Examples

use Orb

defw bitwise_or_example(a: I32, b: I32), I32 do
  a ||| b
end