Larry (Mr. Prototype) on Nostr: I've been on a mission to "integerify" (remove floating point math) from ...
I've been on a mission to "integerify" (remove floating point math) from microcontroller code for a long time. I just got reminded why yesterday with my CH32V003 FLASH space problem. My normal take is to create integer values 10x the actual to get a single decimal place of precision. For example, temperature sensors - a value of 23.7C would be returned as 237. The sensor is not that precise anyway, so why use fp math? Does anyone else do this? If so do you have a different method?
Published at
2023-08-24 07:53:26Event JSON
{
"id": "8346dd45545f36f6290ec2631749438f17d21de7d56e3835e5f08a95b23dc760",
"pubkey": "5a6428039aef4a4150a9bcc00a76d932057ce0b2bb02cdb5dadcda5a19ac61b7",
"created_at": 1692863606,
"kind": 1,
"tags": [
[
"proxy",
"https://floss.social/users/fast_code_r_us/statuses/110943509322065144",
"activitypub"
]
],
"content": "I've been on a mission to \"integerify\" (remove floating point math) from microcontroller code for a long time. I just got reminded why yesterday with my CH32V003 FLASH space problem. My normal take is to create integer values 10x the actual to get a single decimal place of precision. For example, temperature sensors - a value of 23.7C would be returned as 237. The sensor is not that precise anyway, so why use fp math? Does anyone else do this? If so do you have a different method?",
"sig": "0997b97363573eedd83f7a33723d655f3573a6b00017a5ca8e8cb097015ea305afe9c408fb50f805a6d05c5cdda06d2edf413a832df7cb89178db1827ec129df"
}