O'Reilly logo

Object-Oriented Computation in C++ and Java: A Practical Guide to Design Patterns for Object-Oriented Computing by Conrad Weisert

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

3. Defining a Pure Numeric Data Type

3.1. What does “pure numeric” mean?

A pure numeric data item doesn’t represent an object in the real world. It’s an abstract, mathematical entity.

Some pure numeric data types are built into our programming languages. Java calls them “primitive types.” C supports integers (short, int, long) and real number approximations (float, double). C++ and Java inherit those built-in types from C with minor variations.

However, none of these languages supports such mathematical quantities as complex numbers, rational numbers, fixed-point numbers, transfinite numbers, or numbers of arbitrary precision.1 If we need to use such numbers, we must construct them ourselves using OOP’s class definition mechanism (or find a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required