In other languages:

Data types: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Created page with "{{Languages}} Category:Technical This page describes common binary data types used by Factorio, and most modern day computer applications, internally. == Endianness ==...")
 
No edit summary
Line 3: Line 3:
This page describes common binary data types used by Factorio, and most modern day computer applications, internally.
This page describes common binary data types used by Factorio, and most modern day computer applications, internally.


== Endianness ==
== Properties ==


All data stored in computers are stored in single, small unit of data called a "byte". Larger units of data are split into multiple bytes. The order in which sequential bytes are assembled together to form a larger unit of data is referred to as it's "endianess". All data saved locally by Factorio is stored in "little"-endian format (because Intel favored little endian processors in the ancient times). All data transferred over the network by Factorio is done in "big"-endian format (the standard for network stuffs, so much so that it's often refered to as "network"-endian). (Please correct any of this if I'm wrong!!) For more information about endianness, please see the [https://en.wikipedia.org/wiki/Endianness Wikipedia entry].
=== Endianness ===
 
All data stored in computers are stored in single, small unit of data called a "byte". Larger units of data are split into multiple bytes. The order in which sequential bytes are assembled together to form a larger unit of data is referred to as it's "endianess". '''All data saved locally by Factorio is stored in "little"-endian format''' (because Intel favored little endian processors in the ancient times). All data transferred over the network by Factorio is done in "big"-endian format (the standard for network stuffs, so much so that it's often refered to as "network"-endian). (Please correct any of this if I'm wrong!!) For more information about endianness, please see the [https://en.wikipedia.org/wiki/Endianness Wikipedia entry].
 
=== Signedness ===
 
Another property of large data types is it's signedness. Please see the [https://en.wikipedia.org/wiki/Signedness wikipedia entry]. By default, all data types used in Factorio are signed. '''Data types marked with a u- prefixed are unsigned'''. I'm not certain which type of signedness Factorio uses - perhaps it is machine dependant, but for me it always appears to be [https://en.wikipedia.org/wiki/Two%27s_complement two's complement].
 
== Data Types ==
 
Basic numbers stored as a sequence of bits (in order in regards to their endianness).
 
=== byte ===
 
1 byte long integer.
 
=== short ===
 
2 byte long integer.
 
=== int ===
 
4 byte long integer.
 
=== long ===
 
8 byte long integer.

Revision as of 01:29, 11 August 2017


This page describes common binary data types used by Factorio, and most modern day computer applications, internally.

Properties

Endianness

All data stored in computers are stored in single, small unit of data called a "byte". Larger units of data are split into multiple bytes. The order in which sequential bytes are assembled together to form a larger unit of data is referred to as it's "endianess". All data saved locally by Factorio is stored in "little"-endian format (because Intel favored little endian processors in the ancient times). All data transferred over the network by Factorio is done in "big"-endian format (the standard for network stuffs, so much so that it's often refered to as "network"-endian). (Please correct any of this if I'm wrong!!) For more information about endianness, please see the Wikipedia entry.

Signedness

Another property of large data types is it's signedness. Please see the wikipedia entry. By default, all data types used in Factorio are signed. Data types marked with a u- prefixed are unsigned. I'm not certain which type of signedness Factorio uses - perhaps it is machine dependant, but for me it always appears to be two's complement.

Data Types

Basic numbers stored as a sequence of bits (in order in regards to their endianness).

byte

1 byte long integer.

short

2 byte long integer.

int

4 byte long integer.

long

8 byte long integer.