Why computer can't compute 0.1*0.1 or 0.1+0.2 properly. 0.1*0.1 is actually unsolvable by computers because it is impossible for them to define 0.1. Computers will define 0.1 as slightly more or slightly less the the actual 0.1 value. So if you want to print 0.1*0.1, this will result 0.010000000000000002 because this is an approximation. So maybe computers are not really good at math after all...
This is the more complex answer: "Not all floating point numbers are exactly representable on a finite machine. Neither 0.1 nor 0.2 are exactly representable in binary floating point. And nor is 0.3. A number is exactly representable if it is of the form a/b where a and b are an integers and b is a power of 2. Obviously, the data type needs to have a large enough significant to store the number also." - David Heffernan. Alternative title: Computers can't solve this, heres why. Computers sucks at maths.
CREDIT
This video was inspired by Fireship's Youtube Short. @Fireship
Fireship's video: https://www.youtube.com/shorts/s9F8pu5KfyM
LINKS
Online Python Compiler: https://www.programiz.com/python-programming/online-compiler/
Blog Explanation: https://techtalkbook.com/why-0-1-0-2-does-not-equal-0-3/
Stack Overflow = https://stackoverflow.com/questions/7545015/can-someone-explain-this-0-2-0-1-0-30000000000000004
COURSES
Flutter courses (Beginner & Advanced): https://fluttermapp.com/
Flutter courses (Beginner): https://www.udemy.com/course/flutter-for-beginners/?referralCode=41422757DE8BBE99EBD6
OVERVIEW
0:00 to do
MISSION
Our mission at Flutter Mapp (Flutter Mobile App) is to help purpose driven Flutter developers go full-time doing what they love and making an impact through coding. We achieve this with useful Flutter tips and straight to the point Flutter videos.
RECOMMENDED
Playlist of more than100 Flutter tips: https://www.youtube.com/watch?v=5vDq5DXXxss
Best 35 Flutter Widgets: https://youtu.be/M9J-JJOuyE0
Learn Flutter in 3 hours: https://youtu.be/CD1Y2DmL5JM
Zero to Hero Flutter Course (Beginners): https://youtu.be/_RA5aXiY28E
Hero to Pro Flutter Course (Advanced): https://youtu.be/lltn41SS9dg
DISCORD
Invite: https://discord.com/invite/CrdmDraphN
SOCIAL MEDIA:
Instagram : www.instagram.com/fluttermapp
Twitter : twitter.com/FlutterMapp
Website: www.fluttermapp.com
CONTACT
For business inquiries email me here: info@fluttermapp.com
Website: https://fluttermapp.com
#FlutterMapp
#python
#java