-
Notifications
You must be signed in to change notification settings - Fork 1
/
datatypes
21 lines (19 loc) · 915 Bytes
/
datatypes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
because of GM's weak typing, it's hard to tell when GM's using an int and when it's not
int64 will always make a number an integer using a signed integer datatype
if you use a bitwise operator of any kind, GM will cast to int64 internally
as for singles versus doubles for floats, GM uses both!
x = 16777216;
a = 16777216;
show_message( "0: x=" + string( x ) + ",a=" + string( a ) );
x += 1; a+= 1;
show_message( "1: x=" + string( x ) + ",a=" + string( a ) );
x += 1; a+= 1;
show_message( "2: x=" + string( x ) + ",a=" + string( a ) );
x += 1; a+= 1;
show_message( "3: x=" + string( x ) + ",a=" + string( a ) );
x += 1; a+= 1;
show_message( "4: x=" + string( x ) + ",a=" + string( a ) );
bang that into a Create event (or w/e)
you'll see that a increments but x doesn't
...the internal variables x, y, image_angle etc. are stored as single-precision
any variable you define yourself is stored as double-precision