Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> the Unicode string "√5" is representable as 4 UTF-8 bytes

As the other person pointed out, this is representing an irrational number unambiguously in a finite number of bits (8 bits in a byte). I fail to see how your original statement was careful :)

> representable in a finite number of digits or bits





I don’t think those bits unambiguously represent the square root of five. Usually they represent either 3800603189 or -494364107.

Isn't "unambiguous representation" impossible in practice anyway ? Any representation is relative to a formal system.

I can define sqrt(5) in a hard-coded table on a maths program using a few bytes, as well as all the rules for manipulating it in order to end up with correct results.


Well yeah but if we’re being pedantic anyway then “render these bits in UTF-8 in a standard font and ask a human what number it makes them think of” is about as far from an unambiguous numerical representation as you could get.

Of course if you know that you want the square root of five a priori then you can store it in zero bits in the representation where everything represents the square root of five. Bits in memory always represent a choice from some fixed set of possibilities and are meaningless on their own. The only thing that’s unrepresentable is a choice from infinitely many possibilities, for obvious reasons, though of course the bounds of the physical universe will get you much sooner.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: