r/shittyprogramming • • Jun 28 '15

Embedded developer adventures

Post image
297 Upvotes

55 comments sorted by

View all comments

35

u/say_wot_again Jun 28 '15

But.... That's not what they meant when they said double! And how would you tell 1, 10, and 100 apart? I call shenanigans.

1

u/fb39ca4 Jun 29 '15

If you wanted to store two integers in a floating point number, you could store one as the integer part of the number, and the other in the fractional part as its reciprocal. Of course, you can only store one of the numbers signed that way.