Aspen

A toy programming language

Built In Functions

Timing

fn clock()

fn clock() i64

Returns the number of microseconds since the program was started.

Strings

fn itoa()

fn itoa(i64) string

Converts a signed integer to a string.

fn ftoa()

fn ftoa(double) string

Converts a floating point number to a string.

fn atoi()

fn atoi(string) i64

Parses a string as an integer. Zero is returned if the string fails to parse into an integer.

atoi("140");
atoi("-10");
atoi("foo"); // 0 is returned

fn atof()

fn atof(string) double

Parses a string as a floating point number. Zero is returned if the string fails to parse into a floating point number.

atof("2.71");
atof("341");
atof("foo"); // 0 is returned