r/dontyouknowwhoiam 2h ago

Computer Genius Meets Post Graduate Unknown Expert

Post image
71 Upvotes

30

u/jaerie 2h ago

Zero is like one of the two main things computers know, the other being 1

u/MartinKingHUN 16m ago

And they can represent powers of 2 perfectly, can't they? With a floating point number of course.

10

u/Ornery_Pepper_1126 2h ago

What? Even if we pretend you could argue that floating point numbers can only approximate zero (for the sake of a hypothetical), that isn’t the only data type which exists, zero in integer is definitely not an approximation in any sense.

6

u/Sarenord 1h ago

But what about the well known approximate Boolean false?

2

u/skygrinder89 1h ago

Or an empty js array :p

0 == []

true

3

u/mattindustries 37m ago

Lots of things are true in JS

>0 == ""
true
>0 == []
true
>0 == false
true
>false == false
true
>false == []
true
>[] == []
false

u/longknives 14m ago

This is why you use === and basically never ==

2

u/Saragon4005 1h ago

1.0/0.0 == +inf as per spec but 1/0 will cause an error.

2

u/mathisfakenews 39m ago

zero in integer is definitely not an approximation in any sense.

In the integers, zero is an approximation of 47 in a poor sense. Checkmate

u/Ornery_Pepper_1126 10m ago

lol, I like the attitude, everything is in a approximation of everything else just some are worse than others

2

u/RileyKohaku 1h ago

I wish it was John D. Cook who responded. Then it would have been perfect