ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


new:limits

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
new:limits [2018/02/17 22:05] korshunnew:limits [2018/02/17 22:07] korshun
Line 3: Line 3:
 ACSUtils defines constants that represent minimum and maximum values that can be stored in memory blocks (variables) of various sizes. ACSUtils defines constants that represent minimum and maximum values that can be stored in memory blocks (variables) of various sizes.
  
-===== int (signed 32-bit integer) =====+===== Int  ===== 
 + 
 +Int is signed 32-bit integer. Unsigned ints don't exist in ACS, so ''UINT_MAX can't be expressed.
  
   * ''INT_MIN = -2147483648 (-0x80000000)'' -- minimum value   * ''INT_MIN = -2147483648 (-0x80000000)'' -- minimum value
   * ''INT_MAX =  2147483647  (0x7fffffff)'' -- maximum value   * ''INT_MAX =  2147483647  (0x7fffffff)'' -- maximum value
  
-===== Short (16-bit integer) =====+===== Short ===== 
 + 
 +Shorts are 16-bit integers.
  
   * ''SHORT_MIN = -32768'' -- minimum value for signed short   * ''SHORT_MIN = -32768'' -- minimum value for signed short
Line 14: Line 18:
   * ''USHORT_MAX = 65535'' -- maximum value for unsigned short (minimum is 0)   * ''USHORT_MAX = 65535'' -- maximum value for unsigned short (minimum is 0)
  
-===== Byte (8-bit integer) =====+===== Byte ===== 
 + 
 +Bytes are 8-bit integers.
  
   * ''BYTE_MIN = -128'' -- minimum value for signed byte   * ''BYTE_MIN = -128'' -- minimum value for signed byte
Line 20: Line 26:
   * ''UBYTE_MAX = 255'' -- maximum value for unsigned short (minimum is 0)   * ''UBYTE_MAX = 255'' -- maximum value for unsigned short (minimum is 0)
  
-===== fixed (actually 32-bit integer) =====+===== fixed =====
  
-Fixed-point numbers are actually integers and have the same limits as ''int'' (''INT_MIN'' and ''INT_MAX''). But to enable [[strict typing]], there are separate limit constants for ''fixed'':+Fixed-point numbers are 32-bit integers and have the same limits as ''int'' (''INT_MIN'' and ''INT_MAX''). But to enable [[strict typing]], there are separate limit constants for ''fixed'':
  
   * ''FIXED_MIN = (fixed)-0x80000000'' -- minimum value (-32768.0)   * ''FIXED_MIN = (fixed)-0x80000000'' -- minimum value (-32768.0)
   * ''FIXED_MAX = (fixed) 0x7fffffff'' -- maximum value (slightly less than 32767.99999)   * ''FIXED_MAX = (fixed) 0x7fffffff'' -- maximum value (slightly less than 32767.99999)
new/limits.txt · Last modified: 2018/02/17 22:09 by korshun