MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | NAME |
| 2 | integers |
| 3 | |
| 4 | DESCRIPTION |
| 5 | int is the fastest data type in LPC. |
| 6 | |
| 7 | An integer contains a whole number between |
| 8 | -2147483648 and 2147483647. |
| 9 | |
| 10 | Operations with integers: |
| 11 | + plus & AND << SHIFT right |
| 12 | - minus | OR >> SHIFT left |
| 13 | * multiply ^ XOR |
| 14 | / divide (whole) ~ NOT = Assign value |
| 15 | % divide (modulo) += add -= subtract |
| 16 | |
| 17 | The result of a boolean expression is also an integer: |
| 18 | 0 (false) |
| 19 | 1 (true) |
| 20 | |
| 21 | Boolean operators are: |
| 22 | ! (not) |
| 23 | == (equal) |
| 24 | || (or) |
| 25 | && (and) |
| 26 | |
| 27 | FUNCTIONS |
| 28 | int to_int(string) |
| 29 | int to_int(float) |
| 30 | int sscanf(string str, string fmt, mixed var1, mixed var2, ...) |
| 31 | void printf(string format, ...) |
| 32 | |
| 33 | REMARKS |
| 34 | Single characters in strings are also integers. |
| 35 | |
| 36 | SEE ALSO |
| 37 | arrays, mappings, operators, strings, types |
| 38 | |
| 39 | LAST CHANGED |
| 40 | Wednesday, 7th May, 2003, by Amaryllis |