File: float.txt

package info (click to toggle)
colobot 0.2.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 415,536 kB
  • sloc: cpp: 129,246; ansic: 8,872; python: 2,158; sh: 672; awk: 91; xml: 35; makefile: 31
file content (25 lines) | stat: -rw-r--r-- 866 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
\b;Type \c;float\n;
Use this type for most variables that contains numbers. Variables of this type can contain positive and negative numbers, whole or real numbers, for example: 
\c;
\s;	12.9
\s;	1.125
\s;	0.002
\s;	-4.1
\n;
If you need only whole numbers (f. ex. 12 or -5000), you should rather use the type \c;\l;int\u cbot\int;\n;.

\t;Attention
Do not insert space or colon characters into a number. To separate the whole part from the fractional part, use a dot. 
\c;
\s;   Write       and not
\s;   12.56       12 . 56
\s;  -54.34       -54,34
\s;12895.69    12,895.69
\n;
\t;For specialists
Floating point numbers are represented in Colobot with 32 bits.
The highest value that can be represented is 3.4E+38.
The smallest value that can be represented is 3.4E-38.

\t;See also
\l;Programming\u cbot;, \l;types\u cbot\type; and \l;categories\u cbot\category;.