Units
A number can carry a unit. Write the unit after the number.
5 m
3 hours
72 kgEvery unit belongs to a dimension such as Length, Time, or Mass. Arithmetic carries dimensions through, and smoot checks them.
5 m + 30 cm
1 km + 500 m
3 m * 4 m
10 m / 2 s
100 km / 2 hourAdding a length to a mass is an error, not a number. This is the rule that makes smoot trustworthy: a dimension mistake is always reported, never silently coerced.
5 m + 3 kgThe left operand’s unit wins the display: 1 km + 500 m shows kilometres.
Powers and roots carry dimensions too.
(3 m) ^ 2
sqrt(9 m^2)Converting with to
Section titled “Converting with to”to converts a value into another unit.
12 inch to cm
1 mile to km
60 mph to kph
3.6 km/hour to m/s
5 m^2 to cm^2in reads better in some sentences. It works like
as: the answer is shown in the new
unit and the value keeps its own. To convert a value you give a name, use
to.
1 lb in gA unit written straight after a value that already has a unit of the same
dimension converts it too, so trip hour reads like trip to hour. A unit
of another dimension multiplies, as it does after a number.
trip = 90 minute
trip hour
force = 5 N
force mConverting across dimensions is the same dimension error as adding them.
5 kg to mMetric prefixes
Section titled “Metric prefixes”Prefixes are generated for every metric unit, so km, cm, mm, µm,
ms, µs, mg, kJ, MW, and GB all exist. Type µ or u; both work.
1 km to m
500 ms to s
5 um to m
2 GB to MBLong names work with long prefixes: kilometre, millisecond, megabyte.
One spelling is taken: a whole number from 1 to 12 before pm or am
(5 pm) is a time of day. Other counts (74 pm, 12.5 pm) are still
picometres, and long names avoid the clash: 74 picometre.
74 pm to m
74 picometre to mSeveral units at once
Section titled “Several units at once”Two quantities of the same dimension written side by side add up.
5 ft 6 inch
5 ft 6 inch to cm
3 hours 45 minutes to minutesTo display a value across several units, give to a comma list. The
largest unit is peeled off first.
2.5 ft to ft, inch
90 minutes to hour, minute
2250 g to kg, gA unit group is a named list that spans several dimensions. The prelude
ships metric, imperial, and us; each picks the members that fit the
value’s dimension.
5432 m to metric
80 kg to imperial to 0 dp
0 C to imperialThe trailing to 0 dp rounds the last component; see
Formatting.
Temperature
Section titled “Temperature”Celsius and Fahrenheit have offsets, and smoot keeps the arithmetic physical.
Subtracting two temperatures gives a difference; adding a difference to a
temperature gives a temperature. Type °C or just C; results show °C.
Rankine (°R) has Fahrenheit-sized degrees and starts at absolute zero.
100 °C to °F
100 °C to °R
98.6 F to C
300 K to C
100 C - 50 C
20 C + 5 CWhat the prelude ships
Section titled “What the prelude ships”| Dimension | Units |
|---|---|
| Length | m and prefixes, inch, ft, yard, mile, nautical mile, au, light year, parsec, smoot |
| Time | s and prefixes, minute, hour, day, week, fortnight, month, year (the Julian year, 365.25 days) |
| Mass | kg, g and prefixes, tonne, lb, oz, stone, ton, carat |
| Temperature | K, °C, °F, °R |
| Angle | radian, ° (or deg), ′ (arcmin), ″ (arcsec), turn, gradian |
| Area | m^2 and its prefixed forms, hectare, acre |
| Volume | l and prefixes, m^3, cup, tablespoon, teaspoon, pint, quart, gallon, imperial pint (imppint), imperial gallon (impgallon) |
| Speed | mph, kph, any length/time |
| Energy, Power | J, cal, kcal, Wh, kWh, W, hp |
| Pressure | Pa, bar, atm, mmHg, psi |
| Data | B, byte, bit, kB…TB, KiB…TiB, kbit…Tbit |
| Electrical | A, V, ohm and prefixes, coulomb |
| Amount, Frequency, Light | mol, Hz, candela, lumen, lux |
| People | person (also people, head, capita), seat, pax, pppm (per person per month) |
Most units have long names and plurals: metres, feet, hours, pounds.
Answers show a unit’s primary spelling in the singular, whichever alias you
typed: 12 months to years reads 1 year, 500 ml reads 500 mL. To
choose the spelling a unit displays with, declare it: unit ml = mL makes
every millilitre in the document read ml.
The kitchen units are US volumes: cup, pint, gallon. The imperial
ones are prefixed: imperial pint, imperial gallon.