Views : 73,583
Genre: Science & Technology
Date of upload: Jan 12, 2023 ^^
Rating : 4.958 (52/4,941 LTDR)
RYD date created : 2024-04-25T21:55:48.996883Z
See in json
Top Comments of this video!! :3
3:20 2.1 billion is for a SIGNED int. unsigned int goes to 4.2 billion
53 |
Just a heads up on a slight inaccuracy: you described the âsigned magnitudeâ representation of signed integers, but modern hardware doesnât use this. It uses the âtwoâs complimentâ representation. This representation allows for integer addition and subtraction to run on the same hardware, and makes it so taking the negative of a number is as simple as flipping all of the bits of the number and adding 1.
Either way, nice refresher on my CS101 course from a few years ago!
186 |
5:58 correction, we don't use a sign bit to represent a number which would result in the existence of 0 and -0 (negative 0), for example 0000 and 1000 in int4, instead we use 2's complement numbers, where essentially we take the leftmost bit and flip it's sign, for example xyzw int4 would equal to 2^0*w + 2^1*z + 2^2*y - 2^3*x (attention to the minus in the equation)
100 |
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.
40 |
This video on binary numbers and buffer overflow/underflow is an absolute gem! The explanations were clear and easy to follow, and the real-world applications highlighted throughout made the material relatable and understandable. It's a great resource for anyone looking to deepen their knowledge on the subject matter. Thanks for sharing.
10 |
Dude every video you make has something cool and nerdy in it I love it. Thanks for contributing man.
I was installing Linux the other day and wound up on your vids.
I was learning how to a cook a dessert and wound up on your vids.
I was learning about security vulnerabilities and wound up on your vids.
You're like a a modern lightweight tech-Da Vinci. That's intended to be a compliment. :)
112 |
3:24 Should it be *signed*, rather than unsigned? An unsigned 32-bit integer should be able to go up to 4.2bill instead of only 2.1bill, if I'm not mistaken.
19 |
@zander07
1 year ago
I have great respect for people that take any concept, simple or complex, and explain them in a way such that anyone can learn them
437 |