Number
Syntax¶
Any identifier starting with a digit, a period, or a . will be treated as a number. Numbers can also contain underscores between digits which can provide visual clarity without affecting the value of the number.
The compiler will not prevent you from including more than 3 decimal places in a number, however the extra digits will be truncated when processed by DiamondFire due to its precision limit.
There is currently no way to manually write %math expressions. For equations, Terracotta's Expressions should be used.
Operations¶
+ (Addition)¶
num + num: num¶
Adds the left and right Numbers together.
num + str: str¶
Converts the left Number into a String then adds it onto the beginning of the left String.
num + txt: txt¶
Converts the left Number into a String then adds it at the beginning of the right Styled Text.
str + num: str¶
Converts the right Number into a String then adds it onto the end of the right String.
txt + num: txt¶
Converts the right Number into a String then adds it onto the end of the left Styled Text.
- (Subtraction)¶
num - num: num¶
Subtracts the right Number from the left Number.
* (Multiplication)¶
num * num: num¶
Multiplies the two Numbers together.
str * num: str¶
Repeats the left String right number times.
vec * num: vec¶
Multiplies the length of the left Vector by the right Number.
/ (Division)¶
num / num: num¶
Divides the left Number by the right Number.
vec / num: vec¶
Divides the length of the left Vector by the right Number.
^ (Exponentiation)¶
num ^ num: num¶
Raises the left Number to the power of the right Number.
% (Modulus)¶
Returns the modulus of the left Number and the right Number.