(C++) std::scientific
February 24, 2017 · View on GitHub
(C++) std::scientific
std::scientific is a stream manipulator for real numbers to be displayed in the scientific notation.
#include <iostream> int main() { const double x = 123.456; std::cout << x << '\n' << std::fixed << x << '\n' << std::scientific << x << '\n'; }
Screen output:
123.456 123.456000 1.234560e+02