diff options
author | Joel Kronqvist <joelkronqvist@proton.me> | 2024-04-07 13:31:07 +0300 |
---|---|---|
committer | Joel Kronqvist <joelkronqvist@proton.me> | 2024-04-07 13:41:46 +0300 |
commit | 4ff6a08d73f0ef1e2fcb7a93a74cc6fa66c24e2b (patch) | |
tree | 40694627aac44a3f1eb52293b830337b81af69fb /formatting.h | |
parent | f975594e55bdc05ee436bc7bdcd6e09aec5357b1 (diff) | |
download | stdu-4ff6a08d73f0ef1e2fcb7a93a74cc6fa66c24e2b.tar.gz stdu-4ff6a08d73f0ef1e2fcb7a93a74cc6fa66c24e2b.zip |
Bigger `bytes_read` & removed redundant code handling impossible signed `bytes_read`
Diffstat (limited to 'formatting.h')
-rw-r--r-- | formatting.h | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/formatting.h b/formatting.h index b9ef53b..1f96d35 100644 --- a/formatting.h +++ b/formatting.h @@ -3,28 +3,43 @@ #define FORMATTING_IS_IMPORTED struct exp_val { - int mantissa; + unsigned long long mantissa; int exponent; int base; }; typedef struct exp_val exp_notated; -exp_notated int_floored_exponent_notation_base( - int x, +exp_notated ull_floored_exponent_notation_base( + unsigned long long x, unsigned int precision, unsigned int base ); -exp_notated int_ceiled_exponent_notation_base( - int x, +exp_notated ull_ceiled_exponent_notation_base( + unsigned long long x, unsigned int precision, unsigned int base ); -exp_notated int_floored_exponent_notation(int x, unsigned int precision); -exp_notated int_ceiled_exponent_notation(int x, unsigned int precision); -int exp_notated_to_int(exp_notated x); +exp_notated ull_floored_exponent_notation( + unsigned long long x, + unsigned int precision +); +exp_notated ull_ceiled_exponent_notation( + unsigned long long x, + unsigned int precision +); +unsigned long long exp_notated_to_ull(exp_notated x); const char* binary_prefix(exp_notated x); const char* prefix(exp_notated x); -int int_floored_with_binary_prefix(char** res, size_t* res_bufsize, int x); -int int_floored_with_prefix(char** res, size_t* res_bufsize, int x, unsigned int precision); +int ull_floored_with_binary_prefix( + char** res, + size_t* res_bufsize, + unsigned long long x +); +int ull_floored_with_prefix( + char** res, + size_t* res_bufsize, + unsigned long long x, + unsigned int precision +); #endif |