Difference between revisions of "ObjectType:uint"

From Lavish Software Wiki
Jump to navigation Jump to search
 
Line 3: Line 3:
 
== Description ==
 
== Description ==
 
Short for <tt>unsigned integer</tt>, a uint is a positive whole number that can be represented in 32 bits.  This datatype is limited to the numbers 0 to 4,294,967,295 (4 billion).
 
Short for <tt>unsigned integer</tt>, a uint is a positive whole number that can be represented in 32 bits.  This datatype is limited to the numbers 0 to 4,294,967,295 (4 billion).
 +
  
 
== Members ==
 
== Members ==
Line 10: Line 11:
 
* [[DataType:string|string]] '''LeadingZeroes['''#''']''': A string representation of this number, with at least this many decimal places.  The number will be lead with zeroes to reach the desired length
 
* [[DataType:string|string]] '''LeadingZeroes['''#''']''': A string representation of this number, with at least this many decimal places.  The number will be lead with zeroes to reach the desired length
 
* [[DataType:int|int]] '''Signed''': This number as 32-bit signed
 
* [[DataType:int|int]] '''Signed''': This number as 32-bit signed
 +
* [[ObjectType:bool|bool]] '''Between[a,b]''': TRUE if  a<= value and value <= b
 +
* [[ObjectType:bool|bool]] '''Equal['''[[LavishScript:Mathematical Formulae|formula]]''']''': TRUE if the uint matches the specified value
 +
* [[ObjectType:string|string]] '''AsJSON''': A string with the value of the uint, as would be in JSON
 +
 +
 
== Methods ==
 
== Methods ==
 
* '''Inc''': Increments this uint by 1
 
* '''Inc''': Increments this uint by 1
Line 16: Line 22:
 
* '''Dec['''[[LavishScript:Mathematical Formulae|formula]]''']''': Decrements this uint by a given amount
 
* '''Dec['''[[LavishScript:Mathematical Formulae|formula]]''']''': Decrements this uint by a given amount
 
* '''Set['''[[LavishScript:Mathematical Formulae|formula]]''']''': Sets this uint to a given value
 
* '''Set['''[[LavishScript:Mathematical Formulae|formula]]''']''': Sets this uint to a given value
 +
  
 
== Examples ==
 
== Examples ==
Line 28: Line 35:
 
===Decrement an integer===
 
===Decrement an integer===
 
*Count:Dec
 
*Count:Dec
 +
  
 
== See Also ==
 
== See Also ==
 
{{LavishScript:ObjectType}}
 
{{LavishScript:ObjectType}}

Latest revision as of 14:24, 14 October 2019

Object Type Vitals
uint
Defined By LavishScript
Inherits none
Reduces To The string representation of this number
Variable Object Type uint
Uses Sub-Types no
C/C++ Type unsigned int

Description

Short for unsigned integer, a uint is a positive whole number that can be represented in 32 bits. This datatype is limited to the numbers 0 to 4,294,967,295 (4 billion).


Members

  • float Float: This number, converted to a float
  • string Hex: A hexadecimal string equivalent to this number
  • uint Reverse: This number, with its bytes reversed (1234 is turned into 3523477504.. easier to see in hex: 00 00 04 D2 -> D2 04 00 00)
  • string LeadingZeroes[#]: A string representation of this number, with at least this many decimal places. The number will be lead with zeroes to reach the desired length
  • int Signed: This number as 32-bit signed
  • bool Between[a,b]: TRUE if a<= value and value <= b
  • bool Equal[formula]: TRUE if the uint matches the specified value
  • string AsJSON: A string with the value of the uint, as would be in JSON


Methods

  • Inc: Increments this uint by 1
  • Inc[formula]: Increments this uint by a given amount
  • Dec: Decrements this uint by 1
  • Dec[formula]: Decrements this uint by a given amount
  • Set[formula]: Sets this uint to a given value


Examples

Declare an unsigned integer

  • declare Count uint 37

Set an integer's value

  • Count:Set[37430]

Add two integers

  • Total:Set[${Total}+${Current}]

Increment an integer

  • Count:Inc

Decrement an integer

  • Count:Dec


See Also

LavishScript Object Types