Number type
A numeric type is a type whose values represent numbers with a defined representation and support numerical operations.
JavaScript in Depth
The JavaScript built-in numeric type that represents values primarily as IEEE 754 double-precision floating-point numbers.
- How it is used
- Explains decimal rounding surprises, safe-integer limits, and performance differences between small-integer and floating-point arithmetic.
- How deep it goes
- Works from binary encoding through floating-point layout, precision limits, and V8 optimization, without attempting the full IEEE 754 standard.
- Examples
- Uses `0.1 + 0.2`, binary fraction layouts, tolerance functions, and integers around the safe-precision boundary.
- What you can do after
- Diagnose/debug with it when arithmetic fails exact comparisons, integers lose precision, or V8 numeric optimizations disappear.
Grokking Relational Database Design
NUMERIC is an SQL exact numeric data type that stores numbers with a declared precision and scale.
- How it is used
- Defines accurate fixed-point attributes, especially monetary values, during database design.
- How deep it goes
- Explains precision, scale, fixed-point accuracy, and type selection, without descending into storage internals.
- Examples
- Uses 12.3456, product prices and costs, and a spaceship recommended price declared as NUMERIC(8, 2).
- What you can do after
- Apply it to model monetary and other accuracy-sensitive attributes with an intentional precision and scale.
Read how Grokking Relational Database Design explains number type →
Build Financial Software with Generative AI (From Scratch)
NUMERIC is a database data type for storing exact decimal numbers with specified precision and scale.
- How it is used
- Uses NUMERIC to enforce numeric ACH file control amounts in a database.
- How deep it goes
- Defines precision and scale and demonstrates declarations and parsing, without detailing database numeric internals.
- Examples
- Uses ACH file control debit and credit totals declared as NUMERIC(12,2).
- What you can do after
- Evaluate/understand when to use NUMERIC for ACH amounts and anticipate errors from previously accepted non-numeric data.
Read how Build Financial Software with Generative AI (From Scratch) explains number type →
Julia as a Second Language
A number is a mathematical value representing a quantity or position in a numerical system.
- How it is used
- Uses number types to choose numeric representations, convert input, and constrain coordinate types.
- How deep it goes
- Explains type names, bounds, overflow, conversion, and hierarchy exploration; defers unfamiliar number-type and overflow fundamentals to an appendix.
- Examples
- Uses integer bounds and constructors, base-specific parsing, and point and vector types with numeric coordinates.
- What you can do after
- Apply it via Julia to inspect integer bounds, parse numeric strings, and constrain numeric type parameters.
Math for Web Design
The number type is the JavaScript primitive type for numeric values, including integers and floating-point numbers.
- How it is used
- Supports arithmetic for dimensions, animations, dates, financial data, loops, comparisons, and other JavaScript calculations.
- How deep it goes
- Explains IEEE 754 storage, safe integer limits, decimal imprecision, coercion, rounding, randomness, and BigInt boundaries.
- Examples
- Uses unsafe-integer additions, approximate equality, carousel indexing, currency formatting, and random RGB color generation.
- What you can do after
- Diagnose/debug precision, coercion, rounding, unsafe-integer, and remainder problems in JavaScript calculations.
Essential TypeScript 5, Third Edition
The number type is the built-in JavaScript type for numeric values.
- How it is used
- Represents numeric values in JavaScript and supports calculations within dynamically typed programs.
- How deep it goes
- Defines the unified numeric type and demonstrates dynamic reassignment, but defers detailed type coercion mechanics.
- Examples
- Demonstrates prices, typeof output, reassignment, and tax calculations receiving number, string, and boolean arguments.
- What you can do after
- Diagnose unexpected calculations by checking whether values are numbers or strings and observing JavaScript coercion results.
Read how Essential TypeScript 5, Third Edition explains number type →
Clojure: The Essential Reference
A numeric type is a type whose values represent numbers with defined precision, range, and arithmetic behavior.
- How it is used
- Explains how numeric precision, range, promotion, rounding, and overflow affect arithmetic and hashing.
- How deep it goes
- Defines precision and contagion, then works through floating-point rounding and fixed-width overflow without detailing every numeric type.
- Examples
- Demonstrates unchecked operators, long boundary values, floating-point conversion, and a string hash using overflowing arithmetic.
- What you can do after
- Evaluate numeric behavior and choose explicit precision handling instead of relying on contagion rules.
Read how Clojure: The Essential Reference explains number type →
Also covered in
- Building User-Friendly DSLs
- Pro Angular 16
- The Quick Python Book, Fourth Edition
- Everyday Data Visualization
- Statistics Slam Dunk
- ScyllaDB in Action
- API Design Patterns
- Learn Haskell by Example
- Go in Action, Second Edition
- Terraform in Depth: Infrastructure as Code with Terraform and OpenTofu
- Rust in Action: Systems programming concepts and techniques
- Elixir in Action, Third Edition
What to know first
- integerAn integer is a whole-number mathematical value, including negative numbers, zero, and positive numbers, with no fractional part.
- floating-point arithmeticFloating-point arithmetic is numerical computation using finite-precision representations of real numbers, which can introduce rounding and range errors.
- JavaScriptJavaScript is a high-level, dynamically typed programming language standardized as ECMAScript and used for web and general-purpose programming.
- quantitative dataQuantitative data is information represented numerically as quantities, measurements, counts, or other values suitable for numerical interpretation or analysis.
Related concepts
- integerincludes · An integer is a whole-number mathematical value, including negative numbers, zero, and positive numbers, with no fractional part.
- floating-point arithmeticincludes · Floating-point arithmetic is numerical computation using finite-precision representations of real numbers, which can introduce rounding and range errors.
- complex floating-point typeincludes · A complex floating-point type represents complex numbers with real and imaginary components, using floating-point values for those components.
- primitive typekind of · A primitive type is a predefined basic data type representing a simple value rather than a composite structure of multiple values or fields.
- booleanincludes · A Boolean is a logical value or data type representing truth or falsity, conventionally with the two values true and false.
- Number.isSafeIntegerhas part · Number.isSafeInteger is a JavaScript method that tests whether a value is a number representing an integer exactly within JavaScript's safe integer range.
Questions about number type
What is number type?
A numeric type is a type whose values represent numbers with a defined representation and support numerical operations.
Which Manning books explain number type?
JavaScript in Depth, Grokking Relational Database Design, Build Financial Software with Generative AI (From Scratch), Julia as a Second Language, Math for Web Design, Essential TypeScript 5, Third Edition and Clojure: The Essential Reference.
What should I know before learning number type?
Manning books that teach number type usually introduce integer, floating-point arithmetic, JavaScript and quantitative data first.
What kinds of number type are there?
Kinds of number type include integer, floating-point arithmetic, complex floating-point type and boolean.
What is number type a kind of?
Number type is a kind of primitive type. A primitive type is a predefined basic data type representing a simple value rather than a composite structure of multiple values or fields.
What are the parts of number type?
Number type includes Number.isSafeInteger.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.






