Primitive C types
Factor handbook » C library interface » Passing data between Factor and C » C type specifiers

Prev:lookup-c-type ( name -- c-type )
Next:Pointer and array types


The following numerical types are defined in the alien.c-types vocabulary; a u prefix denotes an unsigned type:
C typeNotes
charalways 1 byte
uchar
shortalways 2 bytes
ushort
intalways 4 bytes
uint
longsame size as CPU word size and void*, except on 64-bit Windows, where it is 4 bytes
ulong
longlongalways 8 bytes
ulonglong
floatsingle-precision float (not the same as Factor's float class!)
doubledouble-precision float (the same format as Factor's float objects)

C99 complex number types are defined in the alien.complex vocabulary.

When making alien calls, Factor numbers are converted to and from the above types in a canonical way. Converting a Factor number to a C value may result in a loss of precision.