-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_digit_sep.cpp
More file actions
27 lines (22 loc) · 906 Bytes
/
test_digit_sep.cpp
File metadata and controls
27 lines (22 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// $HOME/bin/bin/g++ -std=c++1y -o test_digit_sep test_digit_sep.cpp
#include <iostream>
int
main()
{
std::cout << std::boolalpha << (1048576 == 1'048'576) << std::endl;
std::cout << std::boolalpha << (1048576 == 0X100000) << std::endl;
std::cout << std::boolalpha << (1048576 == 0x10'0000) << std::endl;
std::cout << std::boolalpha << (1048576 == 0'004'000'000) << std::endl;
std::cout << std::boolalpha << (1048576 == 0B100000000000000000000) << std::endl;
std::cout << std::boolalpha << (1048576 == 0b0001'0000'0000'0000'0000'0000) << std::endl;
std::cout << (1.602'176'565e-19 == 1.602176565e-19) << std::endl;
std::cout.precision(10);
double x = 3.141593654;
std::cout << x << std::endl;
double y = 3.141'593'654;
std::cout << y << std::endl;
unsigned int i = 3141593654;
std::cout << i << std::endl;
unsigned int j = 3'141'593'654;
std::cout << j << std::endl;
}