Lena@gregtech.eu to Programmer Humor@programming.dev · 5 天前What the fuck javascriptimagemessage-square59linkfedilinkarrow-up1410arrow-down111
arrow-up1399arrow-down1imageWhat the fuck javascriptLena@gregtech.eu to Programmer Humor@programming.dev · 5 天前message-square59linkfedilink
minus-squarearty@feddit.orglinkfedilinkEnglisharrow-up11·4 天前$ python Python 3.14.4 (main, Aug 20 2026, 10:41:58) [GCC 15.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> type(float('nan')) <class 'float'>
minus-squarealsimoneau@lemmy.calinkfedilinkarrow-up1·2 天前That never arises in normal use though. I didn’t even know it existed since anything that would yield one raises an exception instead.
minus-squarearty@feddit.orglinkfedilinkEnglisharrow-up1·2 天前But the OP complains specifically about typeof NaN, and not about Math.sqrt(-1) // NaN I know this doesn’t count as “normal use”, but in Python you get it e.g. via math.inf * 0.
$ python Python 3.14.4 (main, Aug 20 2026, 10:41:58) [GCC 15.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> type(float('nan')) <class 'float'>That never arises in normal use though. I didn’t even know it existed since anything that would yield one raises an exception instead.
But the OP complains specifically about
typeof NaN, and not aboutMath.sqrt(-1) // NaNI know this doesn’t count as “normal use”, but in Python you get it e.g. via
math.inf * 0.