Percentages and functions
Percentages
Section titled “Percentages”20% → 20%20% of 80 → 1680 + 20% → 9680 - 20% → 6420% off 150 → 120what percent of 80 is 20 → 25%Words for amounts
Section titled “Words for amounts”twice 50 → 100double 50 → 100triple 50 → 150half 80 → 40half of 80 → 40100 more than 40 → 14030 less than 200 → 170Math functions
Section titled “Math functions”| Function | What it does |
|---|---|
sqrt(x) |
Square root |
abs(x) |
Absolute value |
round(x), floor(x), ceil(x) |
Round to the nearest whole number, down, or up |
log(x), ln(x) |
Base-10 and natural logarithm |
sin(x), cos(x), tan(x) |
Sine, cosine and tangent, in degrees |
min(x, y), max(x, y) |
The smaller or larger of two values |
mod(x, y) |
The remainder of x ÷ y |
sqrt(144) → 12round(3.7) → 4log(1000) → 3sin(30) → 0.5mod(17, 5) → 2Hexadecimal, binary and octal
Section titled “Hexadecimal, binary and octal”Write them with their prefix, and use them like any number:
0xFF → 2550b1010 → 100o17 → 150xFF + 1 → 256Show any number in another base with in:
255 in hex → 0xFF10 in binary → 0b1010255 in octal → 0o3770xFF in decimal → 255