Numeric types
int- 64bit integershort- 32bit integer- double - 64bit floating point
float- 32bit floating point
Constants
Since Argentum numeric constants define both value and type, there were added two suffixes (f and s):
3.14f- a 32bit floating point (float)2f- also 32bit floating point-3.14e-1f- also 32bit floating point in full exponential form.0s- a 32-bit integer (short)0xffffs- also a 32bit in hexadecimal
32-bit constants are limited to:
- 31 significant bits - if decimal - (apply unary minus to change sign if needed)
- 32 significant bits - if binary, octal, hexadecimal
Constants without suffixes define 64bit values.
Operations
- unary bitwise inversion (~) when applied to
short, produceshort, when applied toint- produceint - unary minus is applicable to all numeric types; it produce the result of the same type
- binary operations
+-*/are applicable to all numeric types; they require both operands to be of the same type and produce result of the same type - binary bitwise operators
<< >> & | ^applicable toshortandint; they require both operands to be of the same type and produce result of the same type - comparisons
< > <= >= != ==applicable to all numeric types and require operands of the same type; producingbool.
All integers operations are defined in 32 or 64 bit two's complement arithmetic.
Conversions
There are no automatic conversions between numeric types. All conversions should be performed explicitly:
int(expr)- converts expr to 64bit integer:- if expr it
short(32bit) - it performs sign-extension - if expr is
floatordouble, it converts floating-point value to 64bit int
- if expr it
short(expr)- converts expr to 32bit integer:- from
int(64bit) - it truncates higher bits - from floating-point type - it rounds fractional part and truncates higher bits
- from
float(expr)- convertsint,short,doubletofloatdouble(expr)- convertsint,short,floattodouble.
Blobs
set8At,set16At,set32At- take 32bit (short) valuesget8At,get16At,get32At- return 32bit (short) resultsputChAt- takes 32bit code-point
Strings
All character code-points are 32bit:
Cursor.getCh,peekCh- return 32bit code-point- built-in macro
utf32_(expr, expr,...)expects 32bit code points - Character constants
'H'- produce 32bit character code (short)
