Skip to content

Instantly share code, notes, and snippets.

@yoosefi
Last active November 23, 2015 06:27
Show Gist options
  • Save yoosefi/873f3edf0aa4e7b9b93e to your computer and use it in GitHub Desktop.
Save yoosefi/873f3edf0aa4e7b9b93e to your computer and use it in GitHub Desktop.
draft high-level type conversion table

scalars

coerce to > real (double) int (long) byte (uchar) bool (uchar) string (sprintf)
real (double) IEEE 0xFF mask of int 0x01 mask of int %g
int (long) IEEE 0xFF mask 0x01 mask %ld
byte (uchar) from int sign smear 0x01 mask %c
bool (uchar) 0.0 or 1.0 0 or 1 0x00 or 0x01 "0" or "1"
string (sscanf) %g %ld %c not "" or "0"

complex to complex

coerce to > [] {}
[] {}
[1,2] {"0":1,"1":2}
{} []
{"foo":1,"bar":2} [1,2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment