Files
Espresso/include/math/software_float.h
2025-05-28 14:41:02 -05:00

19 lines
560 B
C

#ifndef _SOFTWARE_FLOAT_H
#define _SOFTWARE_FLOAT_H
#include <stdint.h>
typedef struct {
uint8_t sign; /* 0 = positive, 1 = negative */
uint8_t exponent; /* 8-bit biased exponent (bias = 127) */
uint32_t mantissa; /* 23 bits stored (MSB implicit for normalized numbers) */
} soft_float32_t;
typedef struct {
uint8_t sign; /* 0 = positive, 1 = negative */
uint16_t exponent; /* 11-bit biased exponent (bias = 1023) */
uint64_t mantissa; /* 52 bits stored (MSB implicit for normalized numbers) */
} soft_float64_t;
#endif