From 1a33cfddf6b0a2b60d1c80ea6daa9f71664b214d Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Wed, 23 Feb 2011 14:45:33 +0100 Subject: [PATCH] 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. --- gcode_parse.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcode_parse.h b/gcode_parse.h index da701cb..8866ebe 100644 --- a/gcode_parse.h +++ b/gcode_parse.h @@ -15,9 +15,9 @@ // this is a very crude decimal-based floating point structure. // a real floating point would at least have signed exponent. typedef struct { - uint32_t sign :1; - uint32_t mantissa :28; - uint32_t exponent :3; + uint32_t mantissa; + uint8_t exponent :7; + uint8_t sign :1; } decfloat; // this holds all the possible data from a received command