yorick banner

Home

Manual

Packages

Global Index

Keywords

Quick Reference

Yorick Language Reference

Constants

By default, an integer number is a constant of type long, and a real number is a constant of type double. Constants of the typesshort, int, float, and complex are specified by means of the suffices s, n, f, and i, respectively. Here are some examples:

char    '\0', '\1', '\x7f', '\177', 'A', '\t'
short   0s, 1S, 0x7fs, 0177s, -32766s
int     0N, 1n, 0x7Fn, 0177n, -32766n
long    0, 1, 0x7f, 0177, -32766, 1234L
float   .0f, 1.f, 1.27e2f, 0.00127f, -32.766e3f
double  0.0, 1.0, 127.0, 1.27e-3, -32.766e-33
complex 0i, 1i, 127.i, 1.27e-3i, -32.766e-33i
string  "", "Hello, world!", "\tTab\n2nd line"

The following escape sequences are recognized in type char and type string constants:

\n    newline
\t    tab
\"    double quote
\'    single quote
\\    backslash
\ooo  octal number
\xhh  hexadecimal number
\a    alert (bell)
\b    backspace
\f    formfeed (new page)
\r    carriage return