fork/numbat

git clone https://git.julia.blue/fork/numbat

David PeterAdd examples to the documentatione157883

v1.6.2
316 B10 linesraw
1# This script calculates the Body Mass Index (BMI) based on
2# the provided mass and height values.
3
4unit BMI: Mass / Length^2 = kg / m^2
5
6fn body_mass_index(mass: Mass, height: Length) =
7    mass / height² -> BMI
8
9print(body_mass_index(70 kg, 1.75 m))
10assert_eq(body_mass_index(70 kg, 1.75 m), 22.86 BMI, 0.01 BMI)