r/ProgrammingLanguages • C3 - http://c3-lang.org • May 03 '26

Blog post Unsigned Sizes: A Five Year Mistake

https://c3-lang.org/blog/unsigned-sizes-a-five-year-mistake/
91 Upvotes

115 comments sorted by

View all comments

Show parent comment

2

u/ExplodingStrawHat May 04 '26

How would exponentials work? Would xy for two u8s produce a u263?

2

u/QuaternionsRoll May 04 '26

No, it would produce a u2039 (ceil(log2(255**255))). It doesn’t really matter though, the upper 2031 bits will never be computed if the result is cast to u8.

1

u/Bobbias May 05 '26

Yeah exponential growth is fast. You'd need something like 128 exabytes worth of bits to handle 2 64 bit numbers.