liveBook · Manning

Mathematical function

A mathematical function is a mapping that assigns exactly one output to each permitted input in its domain.

How 2 Manning books explain it

Geometry for Programmers

A mathematical function is a relation that assigns exactly one output to each input in its domain.

How it is used
Frames coordinate-based geometry as rules that map inputs to outputs for transformations, fields, curves, and surfaces.
How deep it goes
Defines functions through relations, domain, codomain, range, and inverse sine, then applies their types and properties in geometry.
Examples
Uses sine and its inverse relation, a circle signed-distance expression, NumPy vectorization, and pixel-image interpolation into a smooth contour.
What you can do after
Apply it via Python, SymPy, and NumPy to express geometric rules and process scalar or array inputs.

Read how Geometry for Programmers explains mathematical function →

Unit Testing Principles, Practices, and Patterns

A mathematical function is a computation that maps each input to exactly one output without hidden inputs or outputs and produces the same output for a given input.

How it is used
Supports output-based unit testing by making behavior explicit, deterministic, and easy to verify.
How deep it goes
Defines purity, hidden inputs, and hidden outputs with code examples, but stops short of a deep functional-programming treatment.
Examples
Uses f(x) = x + 1, CalculateDiscount, deterministic Increment, stateful Increment, and AddComment to contrast explicit and hidden behavior.
What you can do after
Evaluate code for hidden inputs and outputs and design highly testable logic around explicit inputs and outputs.

Read how Unit Testing Principles, Practices, and Patterns explains mathematical function →

Related concepts

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.