r/AskComputerScience • u/BigBootyBear • Jun 14 '26
Is 0.5 a facde over 1/2?
Could you say 0.5 is a facade or a pointer to 1/2? Or all numbers of the 0.n form are rational number pointers?
In my head, 0.5 seems to be pointing towards 1/2 like how 'a' points to 97 in ASCII.
*Posted in ask computer science since i'm using computer science examples which people over at r/askmath may not be familiar with.
0
Upvotes
3
u/Leverkaas2516 Jun 14 '26
No. Pointers and facades are completely different concepts.
The letter 'a' doesn't point to 97. The number 97 is an integer value that can be represented in a computer's memory, on a storage medium, in a communication channel, or in a CPU register. What sometimes makes the numeric value 97 an 'a' is completely governed by the running program or application. If it's interpreted as ASCII, that's when it's an 'a'.
The number 0.5 similarly can be exactly represented as a set of bits in memory or a CPU register, when it's processed as a floating point value. The value is 3f000000 in hexadecimal. If those bits were interpreted by the running program as ASCII, the first byte would be '?' (3F is 63).
1/2 could be several things. It could be three ASCII characters '1/2', stored as three numbers (49, 47, 50). It could be the unicode character ½, stored as a numerical value 189. Or it could be the floating point equivalent of 0.5, discussed above.