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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.