Skip to content

Commit

Permalink
Update src/Unit.h
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdeakin authored May 13, 2024
1 parent 4f17b80 commit ca1c817
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ struct Unit {
enum class Kind { MegaByte, GigaByte, TeraByte, MibiByte, GibiByte, TebiByte };
Kind value;
explicit Unit(Kind v) : value(v) {}

double fmt(double bytes) const {
switch(value) {
case Kind::MibiByte: return std::pow(2.0, -20.0) * bytes;
Expand Down

0 comments on commit ca1c817

Please sign in to comment.