Int

An int stores a 32-bit integer value. Can be defined using the following forms:

var dec = 123 // decimal
var hex = 0x539 // hexademical
var bin = 0b101010 // binary 

Operations

Int values can be subject to:
  • Arithmetical operations: +, -, *, / and ** for raising to power
  • Binary shifts: << and >>

Methods

  • bool to_b: converts to boolean (0 = false, else true)
  • float to_f: converts to float
  • string to_s: converts to string
  • string char: if the integer is in range 0..255, returns a 1-char string, which has the corresponding charcode. Otherwise returns an empty string.

Last edited Mar 14, 2011 at 9:44 PM by impworks, version 3

Comments

No comments yet.