Pure Programmer
Blue Matrix


Cluster Map

Project: Floating Point Overflow

Write a program to print the largest positive floating point value that is possible to represent accurately with [[IEEE doubles]]. Also print a value slightly larger to show what happens on overflow. Does the language produce an error or simply a warning on overflow?

Output
$ g++ -std=c++17 FloatingPointOverflow.cpp -o FloatingPointOverflow -lfmt $ ./FloatingPointOverflow Larg float: 1e+308 Larger float: inf Largest float: inf

Solution