Photo by Logan Kirschner from Pexels

Python vs JavaScript: Numbers

Are you a full-stack Python developer? Or maybe you know Python and want to learn some differences with JS? Sometimes things are easier to remember when put in comparison, so here is a simple cheatsheet of the implementation of numbers in both languages.

Python 3 and a “modern” JS engine are assumed (V8, SpiderMonkey, JavaScriptCore).

Integers

Standard integer (Python int vs JS Number)

Built-in integers with arbitrary precision (Python int vs JS BigInt)

Floats

Python float vs JS Number

Infinity

Not-A-Number

Arithmetic operators

Formatting

Alternatives

JS

Build-in TypedArray
Nodejs C++ addons

Python

Numeric and Mathematical Modules
Numeric and Scientific libs

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response