Reindent decfloat

This commit is contained in:
bumbread 2022-08-05 19:16:49 +11:00
parent b349443f8a
commit 79f1449be3
2 changed files with 230 additions and 237 deletions

View File

@ -1,7 +1,12 @@
#include "decfloat.h"
#include "decfloat_table.h"
typedef struct decfloat_t decfloat_t;
struct decfloat_t {
u64 exponent;
i64 mantissa;
};
#define DOUBLE_MANTISSA_BITS 52
#define DOUBLE_EXPONENT_BITS 11
#define DOUBLE_BIAS 1023
@ -133,8 +138,6 @@ static inline uint64_t div1e8(const uint64_t x) {
return umulh(x, 0xABCC77118461CEFDu) >> 26;
}
static decfloat_t dtodecfloat(const uint64_t ieeeMantissa, const uint32_t ieeeExponent) {
int32_t e2;
uint64_t m2;
@ -214,7 +217,6 @@ static decfloat_t dtodecfloat(const uint64_t ieeeMantissa, const uint32_t ieeeEx
vrIsTrailingZeros = multipleOfPowerOf2(mv, q);
}
}
// Step 4: Find the shortest decimal representation in the interval of valid representations.
int32_t removed = 0;
uint8_t lastRemovedDigit = 0;

View File

@ -1,9 +0,0 @@
#pragma once
typedef struct {
uint64_t mantissa;
int32_t exponent;
} decfloat_t;
static decfloat_t todecfloat(const uint64_t ieeeMant, const uint32_t ieeeExp);