Um, soit's veryinterestingof I justdon't havethe, uh, theabilitytoreadthatkindofdocument, butpalettetoyouifyoudo.
Um, butbasically, itoutlineshownumbersareimplementedinJavaScript, um, andgivesus a reasonwhyZahra 0.1 plus 0.2 doesnotequal 0.3, whichiseveryone's favoriteJavaScriptjoke.
Um, sotheaii 75 fullspecifiestheimplementationoffloatingpointarithmeticinJavascript, whichishowwerepresentdecimalpointsinboundaryandthatallowsustorepresentrealnumbersasanapproximationtosupport a tradeoffbetweenrangeandprecision.
Sowhen I talkaboutrangeandprecision, computershavelimitedspace, they'renotthatamazing.
Um, sorry.
Noevents.
Um, sowhen I talkaboutrangeinjavascript, wehave a rangeofnumbersthat's likethesizeofthesetthatwecanrepresent, sowecanrepresentfromaboutnegativeninequadrillionallthewayuptopositiveninequadrillions.
That's a prettydecentsamplesize.
Andwhen I talkaboutprecision, I maininJavaScript.
Wecanrepresentnumberssafelyto 17 decimalplaces.
Beyondthat, it'lljustgetkindofwacky.
Um, andbecausecomputershavelimitedspace, wehavetomake a tradeoffbetweenrangeandprecision.
Wecaneitherhavegreaterrangeorgreaterprecision.
Wecan't reallyhaveboth, Unfortunately, socomputersaresuperbasic, a punbasedspacetoyouguys.
If I wastryingtomeasureoneSanTomatoand I had 0.16 0 hoursfullcentimetersofera, thatwouldbe 0.903 timesaslongas a glucosemolecule.
Okay, thatseemsprettytiny.
Let's gobigger.
If I weretryingtomeasure a kilometerand I had a marginoferror a 0.16 04 kilometers, thatwouldbe 0.21 0 timesaslongasthedistancefromEarthtothemoon.
Okay, No, bigenough.
Let's gobigorgohome.
If I weretryingtomeasure a letyou, that's thedistancethatlighttravelsin a year, and I had a marginofzeromarginoferrorof 0.16 0 Fulllightis I'd beabout 38.38 centimetersoff, orabouttheheightof a standardbowlingpin.
Inmydefense, Charliestartedthewillyjokesyesterday, so I'm justcarryingonfromherwork.
So I venturedthatwehave a tradeoffbetweenrangeandprecision.
Um, andwhen I mentionedourrange, I said, wehave a rangingjavascriptofaboutnegativeninequadrillionthroughtwopositiveninequadrillion, but I wasn't tellingtheentiretruth.
Waytobuildtrust.
Cool.
Um, soif I wentintomyjobscriptconsoleand I typedin 1.7 times 10 tothepowerof 308 I'd getthatnumberback.
Soobviously I canrepresentthatnumberthat's waybiggerthanninequadrillionninequadrillionsonly, like, 16 zeros.
Andthishas 308.
That's massive.
Um, butif I go 1.8 tothepowertimes 10 tothepowerof 308 aninfinity, I'm confused.
They'rereallyrememberthatbeinghermathsworks, butokay, sojobscriptactuallyhas a maximumvalue.
Um, andsotheproblemhereisthatwhenwetaketheoriginalideas, whichendedin 167 and 168 JavaScriptispassingthemincorrectlywhen I gotthem, becausethosenumbersweretoolarge.
UmAndsowhatwashappening?
Becauseweweregettingthesameideas.
Theframeworkthat I useisinboth, umandMBA.
Dadawassaying, Hey, I'vealreadygot a resourceobjectwiththat.
I d I'm notgonnafetchitagain.
Soherehavebeyondsayagain.
She's againfeature, not a bug, butmybossdidn't thinkso.
Um, somethingtolookoutforwhenyouarehandlingreallybignumbersin a P I responsesisthatsometimestheywillbe a differencebetween, likewhenyouopenyourresponsein a newtabversusindepthtools.
Um, Sowhen I waslookingindepthtools, theideaswereexactlythesame, sotheywerepassedalready.
Whereiswhen I openedtheresponseupin a newtablet?
Wastheoriginal, um, I d thatwas 167168 Um, sothat's notideal.
Um, that's happeninginchromeandsafari.
SoyougetthecorrectUNPaskedintoJoein a newtab, Butthepastintegeranddeaftools, um, inFirefox, yougetthepastintoduringboththenewtabandthedeaftools, youknow, is, um, althoughinedge, nowthatit's chromium, you'llprobablygetthesamebehaviors, Carm.
So, um, that's cool.
I don't reallyunderstandwhythat's happening.
Ifanyoneworksonthesekindoftoolsandcanenlightenme, I wouldlovetoknowwhatit's likedifferentin a newtabversusintheDevTools.
Um, yeah.
Sobecausewehavethe, um, incrementalnumericideas, itwas a problem.
SoassolutionwastomoveThioyouideas, um, whichis a prettycommonsolution.
ItbecameavailableinFirefox 68 betalike a week, whichwassuperexciting.
Ifyournumber's nodelikeme, umanditmeanswecanrepresentnumbersbeyondthatmaximumsafeintoJoe, whichisprettyexciting, Um, sowecancreatethemby a pendingendto a number.
Um, sowetopin 100 endandwereceivedback 100 whichis a biginto, um, Wecanalsousethebigintomethodwith a stringornumber.
Um, wecan't useanyfloatsbecauseitisaninterview, not a floatornotbegintoknowBigdecimal.
Andthere's not a hugeamountofdocumentationavailable.
But, um, thisishow I feelaboutit.
Yes.
Numbers.
Bignumberofcool.
Um, what I thinkismostexcitingaboutthisisthatthisproblemdidn't evenexistwhenjavascriptwascreated.
Likewhat, 23 24 yearsago?
Um, I mean, justjustkindofstilllike a babyintermsofwhatitcoulddo.
ButlikesomebabiesgrowuptobeBeyonce.
So, um, maybeJavaScriptwillgrowuptobabyonsafe.
But I thinkit's reallycoolthat, um, youknow, it's easytogetcaughtupinJavascriptfatiguesometimes, but I thinkit's reallycooltobeworkinginanecosystemthatisconstantlyevolvingandgrowingandloadingandfixingitsmistakes, whichiscool.