Skip to content

Commit 1a33cfd

Browse files
committed
gcode_parse.h: grant mantissa full 32 bits.
This saves 280 bytes of binary size and probably quite a bit of processing time. Cost: 1 byte of RAM.
1 parent bdeb482 commit 1a33cfd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gcode_parse.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
// this is a very crude decimal-based floating point structure.
1616
// a real floating point would at least have signed exponent.
1717
typedef struct {
18-
uint32_t sign :1;
19-
uint32_t mantissa :28;
20-
uint32_t exponent :3;
18+
uint32_t mantissa;
19+
uint8_t exponent :7;
20+
uint8_t sign :1;
2121
} decfloat;
2222

2323
// this holds all the possible data from a received command

0 commit comments

Comments
 (0)