chickadee » foreign » types » unsigned-int32

inttype
unsigned-inttype
int32type
unsigned-int32type

An integer number in fixnum range (-1073741824 to 1073741823, i.e. 31 bit signed). unsigned-int further restricts this range to 30 bit unsigned (0 to 1073741823). int maps to C type int and int32 maps to int32_t.

As an argument type, these expect a fixnum value, and as a return type they return a fixnum. Values outside the ranges prescribed above are silently truncated; you should use e.g. integer if you need the full 32-bit range. Note: int32 is not recognized as an argument type prior to CHICKEN 4.7.2.

Notes for 64-bit architectures:

  • C's int is 32 bits on most 64-bit systems (LP64), so int and int32 are functionally (if not semantically) equivalent.
  • The fixnum type is larger than 32 bits and consequently the entire signed or unsigned 32-bit range is available for this type on 64-bit systems. However, for compatibility with 32-bit systems it is probably unwise to rely on this. If you need a 32-bit range, you should use (unsigned) integer or integer32.