Medication dosage

Run this example

# This script calculates the total daily dose and per intake
# dose of a medication based on a person's body weight.

@aliases(takings)
unit taking

let body_weight = 75 kg
let dosage = (60 mg / kg) / day
let frequency = 3 takings / day

let total_daily_dose = dosage * body_weight -> mg / day
print("Total daily dose: {total_daily_dose}")

let single_dose = total_daily_dose / frequency
print("Single dose:      {single_dose}")