Skip to main content
Version: v0.20.0

Integer

An integer can be positiv or negative and is always internally represented by a 64-Bit Integer.

To cast a negative integer a digit can be prefixed with a - eg. -456.

a = 1;

b = a + 2;

is_true = 1 == 1;
is_false = 1 == 2;

Literal Specific Methods

plz_f()

Returns FLOAT

Converts the integer into a float.

🚀 > a = 456
=> 456
🚀 > a.plz_f()
=> 456.0

🚀 > 1234.plz_f()
=> 1234.0

plz_i()

Returns INTEGER

Returns self

plz_s(INTEGER)

Returns STRING

Returns a string representation of the integer. Also takes an argument which represents the integer base to convert between different number systems

🚀 > a = 456
=> 456
🚀 > a.plz_s()
=> "456"

🚀 > 1234.plz_s(2)
=> "10011010010"
🚀 > 1234.plz_s(8)
=> "2322"
🚀 > 1234.plz_s(10)
=> "1234"

Generic Literal Methods

methods()

Returns ARRAY

Returns an array of all supported methods names.

🚀 > "test".methods()
=> [count, downcase, find, reverse!, split, lines, upcase!, strip!, downcase!, size, plz_i, replace, reverse, strip, upcase]

to_json()

Returns STRING|ERROR

Returns the object as json notation.

🚀 > a = {"test": 1234}
=> {"test": 1234}
🚀 > a.to_json()
=> "{"test":1234}"

type()

Returns STRING

Returns the type of the object.

🚀 > "test".type()
=> "STRING"

wat()

Returns STRING

Returns the supported methods with usage information.

🚀 > true.wat()
=> BOOLEAN supports the following methods:
plz_s()