logo

utils-std

Collection of commonly available Unix tools
commit: 96f2b1b6061e55b08f70bab3d3e78e0ef9ae77eb
parent 195ac0be1ad30429cad0912da4a5d8268db9fa0b
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon, 25 Mar 2024 22:25:05 +0100

lib/humanize: Rename quotient to exponant

Diffstat:

Mlib/humanize.c8++++----
Mlib/humanize.h2+-
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/humanize.c b/lib/humanize.c @@ -22,16 +22,16 @@ dtosi(double num, bool iec) struct si_scale ret = { .number = num, .prefix = "", - .quotient = 0, + .exponant = 0, }; - while(ret.number > div && ret.quotient < PFX) + while(ret.number > div && ret.exponant < PFX) { ret.number /= div; - ret.quotient += 1; + ret.exponant += 1; } - ret.prefix = prefixes[ret.quotient]; + ret.prefix = prefixes[ret.exponant]; return ret; } diff --git a/lib/humanize.h b/lib/humanize.h @@ -9,7 +9,7 @@ struct si_scale { double number; char *prefix; - unsigned quotient; + unsigned exponant; }; struct si_scale dtosi(double num, bool iec);