Chapter 30. double or Nothing

Difficulty: 4

No, this Item isn't about gambling. It is, however, about a different kind of “float,” so to speak, and lets you test your skills about basic floating-point operations in C and C++.

Solution

float and double in a Nutshell

  1. What's the difference between float and double?

Quoting from the C++ standard:

 

There are three floating point types: float, double, and long double. The type double provides at least as much ...

Get Exceptional C++ Style 40 New Engineering Puzzles, Programming Problems, and Solutions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.