/****************************************************************************** * This program computes the size of the universe. * * Copyright © 2016 Richard Lesh. All rights reserved. *****************************************************************************/ #undef NDEBUG #include #include #include #include std::locale utf8loc(std::locale(), new std::codecvt_utf8); using namespace std; static double const UNIVERSE_SIZE_IN_GPARSECS = 14.26; static double const GIGA_PARSEC = 10e9; static double const PARSEC_IN_LIGHT_YEARS = 3.261563777167433562; static double const LIGHT_YEAR_IN_METERS = 9460730472580800.; int main(int argc, char **argv) { setlocale(LC_ALL, "en_US.UTF-8"); wcout.imbue(utf8loc); wcin.imbue(utf8loc); double universe_size_in_meters; universe_size_in_meters = UNIVERSE_SIZE_IN_GPARSECS * GIGA_PARSEC * PARSEC_IN_LIGHT_YEARS * LIGHT_YEAR_IN_METERS; wcout << L"The Universe is " << universe_size_in_meters << L"m across" << endl; return 0; }