Integer

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]

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()