Created
July 9, 2021 17:45
-
-
Save CodeDrome/73e5b951337b33f29b1dcf5fb3e1a8fc to your computer and use it in GitHub Desktop.
mathjsunits10.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bitsAndBytes() | |
{ | |
const bits = math.unit(64, 'bits'); | |
const bytes = bits.to('bytes'); | |
const kilobytes = math.unit(1024, 'bytes'); | |
output(`bits: ${bits}`); | |
output(`bytes: ${bytes}`); | |
output(`kilobytes: ${kilobytes}`); | |
output(`kilobytes to kibibytes: ${kilobytes.to('kibibytes')}`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment