Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
whattheactualf3
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
by
whattheactualf3
5y ago
Here's an example: unsigned int length_a = 10; unsigned int length_b = 20; if (length_a - length_b < 0) { printf("negative diff\n"); } else { printf("positive diff\n"); } I would
2.
▲
by
whattheactualf3
5y ago
It does not express intent. I remember being a junior C programmer and using "unsigned" to express my intent (it's greater than or equal to zero). In reality, like all C keywords, it's completely misleading and actuall
3.
▲
by
whattheactualf3
5y ago
Is it called "unsigned" though? In Racket (and in mathematics) we call those natural numbers. The very notion of "unsigned" was invented by video game programmers at Bell Labs. In mathematics positive numbers are still s
4.
▲
by
whattheactualf3
5y ago
The argument is really strange. It says that unsigned ints can't become negative and it's a good thing. But they do that by instead having crazy high values. How is that a win? You could argue that it doesn't matter because a