Floating Point Numbers

  Рет қаралды 124,315

0612 TV w/ NERDfirst

0612 TV w/ NERDfirst

Күн бұрын

Пікірлер: 322
@NERDfirst
@NERDfirst 5 жыл бұрын
*PLEASE READ THIS COMMENT IN ITS ENTIRETY FOR MORE INFO AND ERRORS IN THE VIDEO* 1. There is an edge case called "Denormal Numbers" that has not been accounted for in this video. Thanks to @PRANAnomaly for sharing! I have made a new video to discuss this concept: kzbin.info/www/bejne/mGOpmHloqLqiiZo Another set of special cases, namely Infinity and NaN, are also not covered in this video. For more details, please watch this other video I made: kzbin.info/www/bejne/emivg52Amrd-gNk 2. ERRATA: At 2:20, note that the number on the right should either be written as 1/2 or 2^-1, but not 2^(1/2)! Thanks 業夝王 for bringing this to my attention! 3. ERRATA: At 15:47, note that the bits from the decimal portion were read off incorrectly. Thank you to spinakker for sharing! This is the version corrected by them: i.imgur.com/ufOeklR.png
@intoeleven
@intoeleven 2 жыл бұрын
Somehow this comment is not pinnted to the top...You can add it to your subtitles.
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you for your comment! Thanks for the heads up! I found that the pinned comment on quite a few of my videos had gotten unpinned somehow. I put them back whenever I come across them.
@intoeleven
@intoeleven 2 жыл бұрын
@@NERDfirst Thanks for the reply. Your videos help me a lot!
@hilaryyang3821
@hilaryyang3821 4 жыл бұрын
This was so far the most helpful video on floating-point representation I've seen. I'm surprised it didn't get more views. Thanks man!
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you very much for your comment! Glad to be of help =)
@ladell5101
@ladell5101 5 жыл бұрын
Thanks, bro! This is SOOOOOO appreciated. I literally have a test on this stuff in about 9 hours.
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you for your comment! All the best for your test =)
@okboing
@okboing 4 жыл бұрын
How did u do
@ladell5101
@ladell5101 3 жыл бұрын
@@okboing Super late, but I passed with a B+.
@markus6056
@markus6056 Жыл бұрын
@@ladell5101YES!
@ivanilanic
@ivanilanic Жыл бұрын
Sir you have a natural talent to teach, thank you sooo much !!
@NERDfirst
@NERDfirst Жыл бұрын
You're welcome! Very happy to be of help =)
@msgabbana14
@msgabbana14 5 жыл бұрын
Thank you! I finally understand this after avoiding the subject for an entire semester..
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you for your comment! Very happy to be of help =) Glad you got over that hurdle!
@bhagyaanuragith8414
@bhagyaanuragith8414 4 жыл бұрын
you just saved my life. there is no other video explaining this stuff more clearly than you.
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! Glad to be of help =)
@lechi_2002
@lechi_2002 4 жыл бұрын
It's much more clear for me how floating point representation works. Thanks!
@NERDfirst
@NERDfirst 4 жыл бұрын
You're welcome! Very happy to be of help =)
@vitzal3691
@vitzal3691 5 жыл бұрын
You definitely earned this sub. This was an amazingly edited video and the information was thoroughly explained, much appreciated! If you want to find the range of this representation is it take all 1s for all the exponent bits for the largest possible exponent, take 1s for all the mantissa bits, add one to the mantissa and then complete the calculation from negative sign to positive sign?
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you very much for your comment and support! If you're looking for the smallest possible number (ie. a negative number) all the way up to the largest positive number, then yes - Just make the largest possible exponent and mantissa with both positive and negative signs and you'll get both. If you want to find the smallest positive number though, that's a bit harder. For that you'll need to look into Denormal numbers, which I did not cover in this video. A denormal number allows you to get an even smaller exponent than the exponent actually allows, by using zeroes in the mantissa. For more: kzbin.info/www/bejne/mGOpmHloqLqiiZo
@casual_gaming_5
@casual_gaming_5 5 жыл бұрын
thanks for putting in so much hard work in creating these videos . amazing explanation on floats .
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you very much for your comment! Glad you found the video useful =)
@mullademir4589
@mullademir4589 2 жыл бұрын
I was pretty lost when I started to study this topic, but thanks to you it's not a problem anymore. Keep up the good work!
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you very much for your comment! Very happy to be of help :)
@nouhamataoui8836
@nouhamataoui8836 5 жыл бұрын
I have been struggling with this chapter for days and you just explained it in 15 minutes ?? I wish I had found this video sooner. Thank you so so much, this was extremely helpful :D
@NERDfirst
@NERDfirst 5 жыл бұрын
You're welcome! Very happy to be of help =)
@daylyght3654
@daylyght3654 5 жыл бұрын
I'm very sure it wasn't easy to put all of these great work together. I thank you for that.
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you very much for your comment! Yeah, this particular video was months in the making, heh. Honestly, quite relieved it's up. Glad you liked it =)
@albertomadalin2209
@albertomadalin2209 2 жыл бұрын
Thank you for making this video. You literally just helped me pass an exam i couldn't have studied on time for. You are the best. Keep up the good work.
@NERDfirst
@NERDfirst 2 жыл бұрын
You're welcome! Very happy to be of help =)
@Hersonrock12
@Hersonrock12 Жыл бұрын
I appreciate so much having found this video, is not only greatly explained. But the page with the Floating point explorer is just beautiful. Thank you!
@NERDfirst
@NERDfirst Жыл бұрын
You're welcome! Very happy to be of help =)
@ThierryPBeaulieu
@ThierryPBeaulieu 3 жыл бұрын
One of the best channels on YT for clarity of explanation! Hats down!
@NERDfirst
@NERDfirst 3 жыл бұрын
Hello and thank you very much for your comment! Very happy to be of help =)
@junkmail4613
@junkmail4613 3 жыл бұрын
I'm 72. Real powerful presentation, and your "Floating Point Explorer" calculator gives a chance to verify my understanding. Thank you. 2021 10 04 (as 2 years after publishing)
@NERDfirst
@NERDfirst 3 жыл бұрын
Hello and thank you very much for your comment! Very happy to be of help =)
@CodingJesus
@CodingJesus 4 жыл бұрын
Amazing video.
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! Glad you liked the video =)
@jiahganara7173
@jiahganara7173 4 жыл бұрын
this is way better than my module! finally get to understand :)
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! Glad you liked the video =)
@brennan5618
@brennan5618 Жыл бұрын
Absolutely excellent video. The website you created is a fantastic learning companion to the concept as well. Thank you!
@NERDfirst
@NERDfirst Жыл бұрын
You're welcome! Very happy to be of help :)
@AudioBoi1
@AudioBoi1 6 ай бұрын
Very good video. Even though I didn't fully understand the process, it's still much easier to wrap my head around this concept overall. Thank you 🙏🙏
@NERDfirst
@NERDfirst 6 ай бұрын
Hello and thank you very much for your comment! Glad to be of help =) If you have anything you'd like me to clarify, feel free to let me know in a comment and I'll do what I can to help you!
@NS-te8jx
@NS-te8jx 3 жыл бұрын
very good explanation.
@NERDfirst
@NERDfirst 3 жыл бұрын
Hello and thank you for your comment! Glad you liked the video =)
@TcG7o3
@TcG7o3 3 жыл бұрын
There is no word that can describe how thankful to you . Thank you for the very helpful lesson.
@NERDfirst
@NERDfirst 3 жыл бұрын
You're welcome! Very happy to be of help =)
@redmoon8965
@redmoon8965 4 жыл бұрын
i see a lot of simplicity in this video , Best WAY to explain stuff , thank you so much buddy !
@NERDfirst
@NERDfirst 4 жыл бұрын
You're welcome! Very happy to have been of help =)
@kaisolacegames
@kaisolacegames 2 жыл бұрын
THANK YOU. The way floating point numbers were explained in my textbook made absolutely no sense. This was easy to follow and actually helped me get my head around the concept. You're the best!
@NERDfirst
@NERDfirst 2 жыл бұрын
You're welcome! Very happy to be of help =) For a more complete understanding, you might want to watch the follow up videos about Denormal numbers, and do take note of the errata in the comments as well.
@tylercollins8075
@tylercollins8075 3 жыл бұрын
Very clearly explained! Thank you for this video
@NERDfirst
@NERDfirst 3 жыл бұрын
You're welcome! Very happy to be of help =)
@pratyaymandal5031
@pratyaymandal5031 3 жыл бұрын
After 2 -3 videos I found this video and it cleared all my doubts and I just want to tell you that I am in love with your explanation .Loveeeeeeee Youuuuuu bro
@NERDfirst
@NERDfirst 3 жыл бұрын
Hello and thank you very much for your comment! Very happy to be of help =)
@kdbin101-1
@kdbin101-1 2 жыл бұрын
Such a clean and intuitive explanation, thank you!! 🙏
@NERDfirst
@NERDfirst 2 жыл бұрын
You're welcome! Very happy to be of help =)
@deinemudda2325
@deinemudda2325 Жыл бұрын
what a legend. I really enjoyed the video. Thank you :)
@NERDfirst
@NERDfirst Жыл бұрын
You're welcome! Very happy to be of help =)
@doug9000
@doug9000 3 жыл бұрын
i try to watch other videos but only on this one i got it, great explanation, thanks!
@NERDfirst
@NERDfirst 3 жыл бұрын
You're welcome! Very happy to be of help =)
@ugandaknuckle6649
@ugandaknuckle6649 3 жыл бұрын
You are a life saver! Subbed!
@NERDfirst
@NERDfirst 3 жыл бұрын
Hello and thank you for your comment! Happy to be of help =)
@Tubeytime
@Tubeytime 3 жыл бұрын
My gratitude... is endless.
@NERDfirst
@NERDfirst 3 жыл бұрын
You're welcome! Glad to be of help =)
@cyrilemeka6987
@cyrilemeka6987 11 ай бұрын
Amazing explanation ❤
@NERDfirst
@NERDfirst 11 ай бұрын
Hello and thank you very much for your comment! Glad you liked the video =)
@mx6you
@mx6you 4 жыл бұрын
Great Explanation. Thanks so much!
@NERDfirst
@NERDfirst 4 жыл бұрын
You're welcome! Very happy to be of help =)
@hongkyulee9724
@hongkyulee9724 2 жыл бұрын
Wow ... I feel like fall in love with floating point numbers... Your video is awsome Thank you :D
@NERDfirst
@NERDfirst 2 жыл бұрын
You're welcome! Very happy to be of help =)
@RossMcgowanMaths
@RossMcgowanMaths 4 жыл бұрын
14.25 -' if it was a zero we could stop it at a different place and express with a different exponent' ? What different place and what different exponent. I have used this video to code the floating point in VBA.It works with everything other than say 0.5. Very good video !
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! What I mean is, if you don't have the rule that the mantissa starts with 1, then all of the below are valid representations of 0.25: 0.25 × 2^1 0.5 × 2^-1 1 × 2^-2 2 × 2^-3 So to make the numbers consistent, the rules say the mantissa has an implied "1." in front.
@rastkostajic5525
@rastkostajic5525 2 жыл бұрын
Thank you, great explanation!
@NERDfirst
@NERDfirst 2 жыл бұрын
You're welcome! Very happy to be of help =)
@aeebeecee3737
@aeebeecee3737 4 жыл бұрын
Very thanks to you for your clear information
@NERDfirst
@NERDfirst 4 жыл бұрын
You're welcome! Very happy to be of help =)
@YRBYD
@YRBYD 4 жыл бұрын
One of the few videos on KZbin regarding floats where IEEE-754 is respected. Good job!
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you very much for your comment! Do note that I do make some mistakes, please refer to the pinned comment for more =)
@CODPRICEGHOST
@CODPRICEGHOST 5 жыл бұрын
Great explanation, best video I found so far for floating point
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video =)
@janiceay5051
@janiceay5051 5 жыл бұрын
Amazing tutorial. Easy to understand than others on youtube.
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you for your comment! Very happy to be of help =)
@51anirudh
@51anirudh 3 жыл бұрын
Loved your way of explanation. Crisp and Clean :) Thank you :)
@NERDfirst
@NERDfirst 3 жыл бұрын
You're welcome! Very happy to be of help =)
@aeebeecee3737
@aeebeecee3737 4 жыл бұрын
Your channel deserve more subscribers
@maherhanna2432
@maherhanna2432 2 жыл бұрын
Thank you very clear explanation
@NERDfirst
@NERDfirst 2 жыл бұрын
You're welcome! Very happy to be of help =)
@georgebenjamin6632
@georgebenjamin6632 4 жыл бұрын
This is excellent!
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video =)
@Gnomfresser1
@Gnomfresser1 4 жыл бұрын
awesome description mate
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! Glad you liked the video =)
@hardiksen9722
@hardiksen9722 4 жыл бұрын
loved it. really helped me. It was the only thing I did not know for my exam. It is in 2 hours.
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! All the best for your exam!
@riccardosola8326
@riccardosola8326 3 жыл бұрын
This was perfectly clear man! Thank you, really!
@NERDfirst
@NERDfirst 3 жыл бұрын
Hello and thank you very much for your comment! Very happy to be of help =)
@arrogantermistkerl4579
@arrogantermistkerl4579 4 жыл бұрын
Great stuff. I really dont miss going to university with videos like this
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video =)
@ltahoe9257
@ltahoe9257 2 жыл бұрын
Omg do you have any idea how many videos I have watched, reread my CPE textbook to try to figure out why we add 1 to the mantissa. My textbook literally says, there's a one but it can be omitted and that bothered me so much that I didn't know. But now it makes sense, technically there is a 2 to the power of zero which is where the 1 comes from. Thank you!!!!!!!
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you very much for your comment! Glad to be of help =)
@rekxspein
@rekxspein 4 жыл бұрын
Damn, so clearly explained, man when I read in books I didn't understand at all 🤣🤣🤣
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! Glad to be of help =)
@muhammadtaimourafzal5285
@muhammadtaimourafzal5285 4 жыл бұрын
Great explanation
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! Glad to be of help =)
@jackchan2557
@jackchan2557 5 жыл бұрын
great explanation!
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you for your comment! Glad you liked the video =)
@zekfad
@zekfad 5 жыл бұрын
Thank's so much for a such quick video with a such huge impact on knowledge!
@NERDfirst
@NERDfirst 5 жыл бұрын
You're welcome! Very happy to be of help =)
@apall2764
@apall2764 5 жыл бұрын
Gee I delved the whole Internet for a simple clear explanation like this Many thanks Bro!
@NERDfirst
@NERDfirst 5 жыл бұрын
You're welcome! Very happy to be of help =)
@Kevin-tx6gw
@Kevin-tx6gw Жыл бұрын
king i learnt more from you in 19 minutes than in my university lecture
@NERDfirst
@NERDfirst Жыл бұрын
Hello and thank you for your comment! Glad to be of help =)
@xer_t3661
@xer_t3661 3 жыл бұрын
amazing explanation
@NERDfirst
@NERDfirst 3 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video :)
@ryanzkp
@ryanzkp 3 жыл бұрын
Thank you sooooooooo much! I finally got it!
@NERDfirst
@NERDfirst 3 жыл бұрын
You're welcome! Very happy to be of help =)
@heeseok7792
@heeseok7792 4 жыл бұрын
Man.... u r the first one to make me have clear picture on this 👍👍
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you very much for your comment! Glad to be of help =)
@vaz5926
@vaz5926 4 жыл бұрын
Thank you, man! Super helpful!
@NERDfirst
@NERDfirst 4 жыл бұрын
You're welcome! Very happy to be of help =)
@pareeksharao6524
@pareeksharao6524 2 жыл бұрын
thats amazing video finally after 4 days i got some easy and interesting video to learn floating point representation thakuu sir
@NERDfirst
@NERDfirst 2 жыл бұрын
You're welcome! Very happy to be of help =)
@_AmHam_
@_AmHam_ 4 жыл бұрын
Thank you sooo much !!!
@NERDfirst
@NERDfirst 4 жыл бұрын
You're welcome! Happy to be of help =)
@lucasrodriguesdelima8697
@lucasrodriguesdelima8697 2 жыл бұрын
This video is amazing !!!! Thank you so much .. :)
@NERDfirst
@NERDfirst 2 жыл бұрын
You're welcome! Very happy to be of help =)
@totem1997
@totem1997 Жыл бұрын
Thanks…..I will revisit this video couple of times in order to fully understand floating point.😊
@NERDfirst
@NERDfirst Жыл бұрын
Hello and thank you for your comment! Feel free to do so, and to clarify any doubts in the comments if you need :)
@TheTariqibnziyad
@TheTariqibnziyad 4 жыл бұрын
Love your video man !!!
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! Glad you liked the video =)
@cokelight12
@cokelight12 5 жыл бұрын
Hats of to you sir, everything is crystal clear now :)
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you very much for your comment! Happy to be of help =)
@yousefelsayed4203
@yousefelsayed4203 Жыл бұрын
Thank you very much this helped me a lot ❤
@NERDfirst
@NERDfirst Жыл бұрын
You're welcome! Glad to be of help =)
@anniesue1
@anniesue1 3 жыл бұрын
Nice explanation/narration. Nice animations and graphical illustrations. Clear and concise while being thorough enough. The light reflections in your glasses are somewhat distracting tho...
@NERDfirst
@NERDfirst 3 жыл бұрын
Hello and thank you very much for your comment! The reflections are hard to avoid when you want to light someone face-on, unfortunately! I've been experimenting with other placements to see the effect.
@alexmay7250
@alexmay7250 2 жыл бұрын
this video was amazing, you would be a great professor
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you very much for your comment! I do teach in physical classes, so it's good to hear the vote of confidence =)
@alexmay7250
@alexmay7250 2 жыл бұрын
@@NERDfirst came back to review for my finial exam, your students are very lucky
3 жыл бұрын
thank you very much, great explanation! :-) Cheers from Czech republic.
@NERDfirst
@NERDfirst 3 жыл бұрын
You're welcome! Very happy to be of help =)
@dulmin_
@dulmin_ 3 жыл бұрын
2:20 I'm confused here. I fairly remember that we were taught; 2^(1/2) = "Square root of 2" (which is not 0.5) But if 2^(-1) means "1 upon 2^1", then it's 1/2 = 0.5 as you are saying. I assume it's a screen error. Am I right? Or maybe I'm not understanding your tutorial property. Is that so ? 🤔
@NERDfirst
@NERDfirst 3 жыл бұрын
Hello and thank you for your comment! Sorry for the confusion, yes that is a typo on my part.
@dulmin_
@dulmin_ 3 жыл бұрын
@@NERDfirst Hi dear sir, I learnt a lot from your video!! Things I never understood before, are now very clear. I'm an audio producer, and I was curious to know why higher wav bit-depth(s) have the prefix "floating point". Thank you so much for this explanation, all your time spent on preparing these, and for your very quick reply to the initial comment above. (I asked it just bec I have weak confidence in maths, and I wasn't sure whether that's actually a typo, or perhaps something which I don't understand.)
@olivier306
@olivier306 2 жыл бұрын
Legendary guy!!!!
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video =)
@PCHerc
@PCHerc 2 жыл бұрын
Excellent!
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you for your comment! Glad you liked the video =)
@코알라-r6m
@코알라-r6m 2 жыл бұрын
very helpful thanks
@NERDfirst
@NERDfirst 2 жыл бұрын
You're welcome! Very happy to be of help =)
@Farreach
@Farreach 2 жыл бұрын
i am so confused at the @8:15 marker where you have 9/128 (not sure where that came from ) what am i missing
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you for your comment! Let me try to walk through the entire process. The two bits that are 1 are in the 2^-4 and 2^-7 positions respectively, so they come out to (1/16) and (1/128). To figure out what value they represent, you have to add these numbers together. So we're trying to do 1/16 + 1/128 = 8/128 + 1/128 = 9/128.
@qwerty_____146
@qwerty_____146 Жыл бұрын
Thank you dear Bro. Thant's great. Nice. good job. 🙏
@NERDfirst
@NERDfirst Жыл бұрын
You're welcome! Glad to be of help =)
@keskim
@keskim 5 жыл бұрын
Great video!
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you for your comment! Very happy to be of help =)
@JOURNEY-NEVER-ENDS
@JOURNEY-NEVER-ENDS 3 жыл бұрын
nice video very good
@NERDfirst
@NERDfirst 3 жыл бұрын
Hello and thank you for your comment! Glad you liked the video :)
@jojisamuel6765
@jojisamuel6765 2 жыл бұрын
Thank you so much.
@NERDfirst
@NERDfirst 2 жыл бұрын
You're welcome! Glad to be of help =)
@poorman-trending
@poorman-trending 5 жыл бұрын
You said if the exponent part is zero then the exponent is -127, but that’s not what I get when I put in all zeros for the exponent in an online calculator. I’m confused... (7:45)
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you for your comment! Did you forget to change all the exponent bits? Remember the last bit of the exponent "cuts into" the second byte.
@poorman-trending
@poorman-trending 5 жыл бұрын
@@NERDfirst No, it says the exponent is -126 on all the calculators I've found online. Here's an example: www.h-schmidt.net/FloatConverter/IEEE754.html
@NERDfirst
@NERDfirst 5 жыл бұрын
Thanks for sharing! This seems like a special edge case called "denormalized numbers" where the exponent is used differently from the usual rules. I'll see how I can add on to this video. Source: en.wikipedia.org/wiki/IEEE_754-1985#Denormalized_numbers
@NERDfirst
@NERDfirst 5 жыл бұрын
@@poorman-trending I have updated my simulation resources.nerdfirst.net/float so it reflects the correct behavior. I'll make another video to cover the concept of denormal numbers.
@sajidhaniff7558
@sajidhaniff7558 4 жыл бұрын
at 15:29, why is the sign 0?
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! The number 17.125 is positive, so the sign bit is zero. As a general rule of thumb, seeing 0 for the sign bit indicates a positive number, and 1 indicates negative.
@sajidhaniff7558
@sajidhaniff7558 4 жыл бұрын
@@NERDfirst wow thanks a lot
@Shubham-bj3yp
@Shubham-bj3yp 2 жыл бұрын
Please, make a video on reason of output of ------- float a=3.4; if(a==3.4) printf("hello"); else printf("hii");
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you for your comment! When working with floating point numbers, floating point imprecision may cause the number to be different from what you expect - In this case here, the variable a might get stored as 3.400001 or something along those lines. Because of this, it doesn't exactly match the equality comparison, and falls into the else block. It's best to test floating point numbers in a range rather than with an equality operator like this.
@ghb323
@ghb323 4 жыл бұрын
12:23 in general, infinutely repeating digits happens if its reduced fraction form have a denominator that have at least a prime factor number other than the base’s. In order to have a terminating radix fraction, all its prime factors must match between the radix and fraction denomator. For example, in the real world, we use decimal (10). Since the prime factors of 10 is 2 and 5, all fractions that have all it’s prime factor being 2 or 5 means that the digits will terminate at some point. 1/3, however isn’t doesn’t use 2 or 5, so you get infinutely repeating 3s. In binary, the base is 2. 1/10 results repeating binary string because at least one prime factor of 10 isn’t 2, and that is the number 5. It will look like this in binary: 0.0[0011] where the bracketed part repeats.
@NERDfirst
@NERDfirst 4 жыл бұрын
What an interesting property! Thank you for sharing =)
@louiseghemmam8056
@louiseghemmam8056 4 жыл бұрын
thank youuu !!
@NERDfirst
@NERDfirst 4 жыл бұрын
You're welcome! Glad to be of help =)
@fortamx
@fortamx Жыл бұрын
Hey man, great video! Could you explain why the exponent is represented with an offset and not another representation such as 2-complement? Thanks for the video!
@NERDfirst
@NERDfirst Жыл бұрын
Hello and thank you for your comment! The short answer would be "That is how it's designed", but naturally I was curious also as to why it was designed this way. Some people suggest that this helps with comparing two numbers - With the offset representation you could simply compare the bit strings of two floating point numbers as if they were integers and the answer would be correct. I wasn't able to find an official source to say that this is the reason why it was designed like that but it does seem to make a lot of sense. Some sources where this is discussed: employees.oneonta.edu/zhangs/csci201/IEEE%20Floating%20Point%20Format.htm stackoverflow.com/questions/2835278/what-is-a-bias-value-of-floating-point-numbers
@kellyprice882
@kellyprice882 4 жыл бұрын
I LOVE YOU MAHN 😭😭
@kpriemko
@kpriemko 5 жыл бұрын
Thx, bro, you get the job done. There is no misunderstanding here now.
@NERDfirst
@NERDfirst 5 жыл бұрын
You're welcome! Very happy to be of help =)
@aswinramachandran7103
@aswinramachandran7103 5 жыл бұрын
dude you are amazing keep making videos like this it is so damn helpful
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you very much for your comment! Very happy to be of help =)
@georgepalafox5967
@georgepalafox5967 5 жыл бұрын
Hi. Great explanation. Quick question. In (11:57) u state one subtract from 0.5 is 0. Not clear. Can u explain again pls?
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you for your comment! For each "layer", the answer comes from the previous number multiplied by two. For the final "layer", 0.5 × 2 gives 1. Since it is greater than or equal to one, we subtract one. This leave us with zero.
@Abon963
@Abon963 Жыл бұрын
Thanks!
@NERDfirst
@NERDfirst Жыл бұрын
You're welcome! Glad to be of help :)
@ngkhai5935
@ngkhai5935 4 жыл бұрын
I dont care who you are, where you're from. I just want to say I fking love you.
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you very much for your comment! Glad you found the video helpful =)
@Lekvar01
@Lekvar01 4 жыл бұрын
I think there might be a mistake around 15:47: i.imgur.com/ufOeklR.png Your final string is correct so this must be a type. Still a great video!
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! Well spotted! I'll go ahead and add a note to the pinned comment. I'll link to your picture and give you credit. Thanks!
@qwerty_____146
@qwerty_____146 Жыл бұрын
Hi, At 15:49 I think you must write 10001.001 or 10001.100 ???? Thank you dear bro
@NERDfirst
@NERDfirst Жыл бұрын
Hello and thank you for your comment! The bits should be read .001, ie. The video is wrong. You can refer to the pinned comment for further clarification.
@mytech3833
@mytech3833 4 жыл бұрын
I don't why you have very less subs I believe you will reach to millions of subs Soo fast
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! I don't do marketing of any kind, so that's one reason why!
@thisrandomdude_
@thisrandomdude_ 2 жыл бұрын
Fantastic video! Very interesting stuff. One question though, why subtract 127 in the exponent section? What led to that being the number to offset by? I'm guessing it's somehow related to 2^7 (128) but why is it 1 less than 128 and not just the entire thing?
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you for your comment! This is a very interesting point. Of course, we know it's got to be between 127 and 128, since that's halfway in between the given 8-bit space, and we ideally want to have an equal number of positive and negative numbers. But as to why 127 has been chosen, I haven't been able to find an official reasoning for it. The best explanation I've found so far is that this makes it easy to compare two floating point numbers with each other using integer representations, and still be able to tell which is larger or smaller. But I'm not sure if there's any proof to say this is really the reason why IEEE chose excess-127 representation for the exponent. Some sources where this is discussed: employees.oneonta.edu/zhangs/csci201/IEEE%20Floating%20Point%20Format.htm stackoverflow.com/questions/2835278/what-is-a-bias-value-of-floating-point-numbers
@thisrandomdude_
@thisrandomdude_ 2 жыл бұрын
@@NERDfirst Thank you so much for the reply, even several years after the making of this video! Your comment helped me understand a bit more about the way floating point numbers work, but I'm still not at the point where I know what integer representations are and all that. Much less whatever was being discussed on that stack overflow thread hahaha. Looking forward to be able to understand all that one day though! Your sheer knowledge and readiness to share it really shows your passion for the subject :) I'm really glad we have people like you to help us noobs out, you're really doing a service to the world!
@NERDfirst
@NERDfirst 2 жыл бұрын
No problem! All I want to do is to make learning more accessible, so I'm really glad I could be of help! "Integer representations" just refer to reading off the string of bits as a whole number, instead of breaking up the bits into sign, exponent and mantissa parts. So even if we just treated it (wrongly!) as a whole number, comparison operations would still make sense and give correct answers. If you're interested to find out more about bits I have another video here that you might like to look over: kzbin.info/www/bejne/aoLPpGash6aSfJY Again, thank you very much for your nice comment. Makes it all worth it =)
@thisrandomdude_
@thisrandomdude_ 2 жыл бұрын
@@NERDfirst I can't believe how helpful that was! I can literally feel my brain expanding by the minute hahahaha. No matter how many times I thank you, it probably won't be enough, so here's a few cookies instead: 🍪🍪🍪🍪🍪🍪🍪🍪🍪🍪 enjoy! While you enjoy munching on them, I'm gonna go do myself a favour and check out your other stuff ;P see you!
@NERDfirst
@NERDfirst 2 жыл бұрын
Thank you very much! Yes, please do feel free to check out the other videos and if you have any other thoughts or questions, don't hesitate to comment on those too =)
@das_evoli
@das_evoli 2 жыл бұрын
I don't really understand this part at 7:00 Why can't they just represent the Exponent by just writing 00000100? Why do we need to make it as an offset
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you for your comment! The exponent can be a positive number (to represent large numbers), or a negative number (to represent small numbers). Having an offset exponent allows you to get negative exponents after doing the calculation, which is why it exists. This offset method isn't the only way of representing negative numbers in computer science, but is the strategy adopted for floating point numbers.
@konstantinrebrov675
@konstantinrebrov675 5 жыл бұрын
Great stuff! This video was in fact published just before we were going to cover it in class. Coincidence?
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you for your comment! Heh, as much as I'd like to say I carefully calculated the timing to coincide with the uni semester, I'm afraid it's complete coincidence =P
@yaribnevarez2541
@yaribnevarez2541 4 жыл бұрын
Excelente!
@yaribnevarez2541
@yaribnevarez2541 4 жыл бұрын
Thanks!
@NERDfirst
@NERDfirst 4 жыл бұрын
You're welcome! Glad to be of help =)
@saikrishnapechetti8382
@saikrishnapechetti8382 4 жыл бұрын
Hello, have you created any playlist regarding these kinda topics ,cause i can't find one in your playlists
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! It depends on what you mean by "these kinda topics" - Floating point numbers is at the intersection of a few broad categories, and you could be referring to any of them. Alternatively you may also want to sort my channel by most popular. Barring a few product reviews which might be less interesting to you, I think you'll find most of the others to at least be relevant.
@eliosgreek8028
@eliosgreek8028 4 жыл бұрын
great video.
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! Glad you liked the video =)
@LinhNguyen-nh8oq
@LinhNguyen-nh8oq Жыл бұрын
Oh now I understand why we have to subtract 127: cause the exponent is 8 bit, so the max of it is 0-255. Inorder to represent smaller number(by multiply it with 2^-5 for ex), we have to represent the exponent in negative number => Split 255 in half = 127. And a second problem is why 2^ but not 10^ because by using base 2, we can convert bit to float and float to bit 😁
@NERDfirst
@NERDfirst Жыл бұрын
Hello and thank you for your comment! I would say simply that we use Base 2 because computers represent information in binary. Even when it's in bits (base 2), it already _is_ a floating point number,
Denormal Numbers - More Floating Point Madness!
12:08
0612 TV w/ NERDfirst
Рет қаралды 18 М.
how floating point works
17:48
jan Misali
Рет қаралды 394 М.
Какой я клей? | CLEX #shorts
0:59
CLEX
Рет қаралды 1,9 МЛН
Counter-Strike 2 - Новый кс. Cтарый я
13:10
Marmok
Рет қаралды 2,8 МЛН
This glitch is in every game ever made
6:48
Jabrils
Рет қаралды 274 М.
Floating Point Numbers (Part1: Fp vs Fixed) - Computerphile
15:41
Computerphile
Рет қаралды 161 М.
Why 0.1 + 0.2 === 0.30000000000000004: Implementing IEEE 754 in JS
16:43
Low Byte Productions
Рет қаралды 69 М.
How Floating-Point Numbers Are Represented
9:56
Spanning Tree
Рет қаралды 39 М.
I built my own 16-Bit CPU in Excel
15:45
Inkbox
Рет қаралды 1,7 МЛН
The Genius Way Computers Multiply Big Numbers
22:04
PurpleMind
Рет қаралды 283 М.
Floating Point Numbers - Computerphile
9:16
Computerphile
Рет қаралды 2,4 МЛН