teacher: if I have 0.1 apples in one hand and 0.2 apples in the other hand, how many apples do I have? javascript: 0.30000000000000004
@iamdevloper And they say AI will take over the world when computers can't even add.
@iamdevloper That's not really JS specific, AFAIK that is a well known float precision problem.
@iamdevloper The correct answer today is: LIBERTY LIBERTY LIBERTY LIBERTY LIBERTY LIBERTY LIBERTY LIBERTY LIBERTY
@iamdevloper 0̵̨́͛̂̈́͘.̴̮̭͇͙̬̻̯͐̉̿̃̏̀̇̀̚͜͝3̴̝̤̠̞̎͆̔͆̌̍̃͑̒̕͜0̶̰̍̓͂̒̈0̴̨̼̦̞̩̬̟̖̈̚0̷̛̞͙̓̿̌͜͠0̸̨̖̇͆͌͜0̸̣̤͖̖͉͒͛͛̓̀͐̀͠0̸̨̤̤͗͒̐͛̀̑͐͑͌̀0̸̨̛̰̻̙̬̪̟͗́͛̆̀̆́͠͝0̷͎̼͙̖̹̪̫̪͌̀͛̄͛͝0̸͔̗͙̍̈́̄̔̄̐́̈̉͝0̵̢͔̰͇̳̌͆̑̒͒ͅ0̵̢̱̽̅͊0̵̧̧̨̜̣̱͍̮̣͑̔̆̑̌͌̕͝0̵̥̻̟̳̒͐̐̑0̷͓̮̰̭̳͉̟̀̈́͜0̸̳͓̻̪̹͖͒͋ͅ4̵̯̹̺̭̻̜̗̖͔͆̈͊̐̈́̒̅̅
@iamdevloper Excel: that looks like a date
@iamdevloper This might be of interest... 😉 docs.oracle.com/cd/E19957-01/8…
@iamdevloper Now that you mention this, I want to thank whoever came up with and implemented Python's Decimal class.
@iamdevloper The floating point precision made the apples float. 😂
@iamdevloper That's the juice you get on your hands from slicing apples
@iamdevloper In any language that uses floating point, not a JS phenomenon.
@iamdevloper Almost everyone is looking at small epsilons for small numbers, but let's not forget what happens when numbers get large (one can't have 64bits integers on JS!) randomascii.wordpress.com/2020/09/27/flo…
@iamdevloper I tried this quickly on my firefox console and it says 0.4
@iamdevloper I mean, are you *sure* that there are absolutely no apple crumbs on your palm?
@iamdevloper If I take one apple from you, you’ll still have -0.7 apples left.
@iamdevloper 0, because I'm only interested in full apples.
@iamdevloper Ask special question, get special answer....
@iamdevloper ah, that's how my bank calculates my interest rates on savings...stupid apples