General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
p11
Mental Outlaw
comments
Comments by "p11" (@porky1118) on "Signed and Unsigned Binary Numbers" video.
It's not true, that bigger integers are necessarily slower. Often math on bigger integers is even faster than on smaller ones. The most efficient number is often the one corresponding to the architecture. If you're on a 32 bit system, 32 bit integers are often the fastest, if you're on a 64 bit system, 64 bit integers are often the fastest. But what's more important than that is cache size and alignment. Using bigger numbers might be bad for the cache, using different sizes of integers depending on the use case might be bad for the alignment. The latter is normally optimized by the compiler, so there is empty space between integers, so you don't have the smaller size for using smaller integer sizes for some values, while still using having the overhead of doing math with smaller integer sizes.
41
@salsamancer usize is the default in rust.
6
0:15 I wouldn't agree that integers don't represent fractional numbers. It can represent whatever you want. 1 BTC is not represented by the number 1, but by the number 100000000.
1
You can also have fixed point numbers (instead of floating point) using integers.
1