mirror of https://github.com/flysand7/ciabatta.git
Reindent decfloat
This commit is contained in:
parent
b349443f8a
commit
79f1449be3
|
@ -1,7 +1,12 @@
|
||||||
|
|
||||||
#include "decfloat.h"
|
|
||||||
#include "decfloat_table.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_MANTISSA_BITS 52
|
||||||
#define DOUBLE_EXPONENT_BITS 11
|
#define DOUBLE_EXPONENT_BITS 11
|
||||||
#define DOUBLE_BIAS 1023
|
#define DOUBLE_BIAS 1023
|
||||||
|
@ -133,8 +138,6 @@ static inline uint64_t div1e8(const uint64_t x) {
|
||||||
return umulh(x, 0xABCC77118461CEFDu) >> 26;
|
return umulh(x, 0xABCC77118461CEFDu) >> 26;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static decfloat_t dtodecfloat(const uint64_t ieeeMantissa, const uint32_t ieeeExponent) {
|
static decfloat_t dtodecfloat(const uint64_t ieeeMantissa, const uint32_t ieeeExponent) {
|
||||||
int32_t e2;
|
int32_t e2;
|
||||||
uint64_t m2;
|
uint64_t m2;
|
||||||
|
@ -214,7 +217,6 @@ static decfloat_t dtodecfloat(const uint64_t ieeeMantissa, const uint32_t ieeeEx
|
||||||
vrIsTrailingZeros = multipleOfPowerOf2(mv, q);
|
vrIsTrailingZeros = multipleOfPowerOf2(mv, q);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 4: Find the shortest decimal representation in the interval of valid representations.
|
// Step 4: Find the shortest decimal representation in the interval of valid representations.
|
||||||
int32_t removed = 0;
|
int32_t removed = 0;
|
||||||
uint8_t lastRemovedDigit = 0;
|
uint8_t lastRemovedDigit = 0;
|
||||||
|
|
|
@ -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);
|
|
Loading…
Reference in New Issue