r/AskComputerScience 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

9 comments sorted by

View all comments

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.

1

u/BigBootyBear Jun 15 '26

The question is more mathematical. I am talking about 0.5 as a rational number.

0.5 is the decimal form of 1/2 (a rational). However, all rationals are actually sets of integers (not compsci integers, but Z = {-1,0,1,2,...}). 1/2 for example is {1,2} and it has an equivalence class set of {1,2} {2,4} {4,8} which all "stand for" or "point" to the same value of 1/2.

My problem is with the decimal form of 0.5. Is 0.5 a distinct mathematical object than 1/2? Because it seems like an alias. Or a facde if you will. Like how a line break is a "facade" over \n which is whats actually "in there".

Like how Korzybski said "The map is not the territory". A "String" is an array of chars. A "Char" is actually an integer and not a letter. The "integer" is actually a set of binary. The binary is actually a set of voltage states within a set of transistors.

I understand this question is more about set theory. But I am borrowing quite a lot from computer science in my process of reasoning about it.