File tree Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ #pragma once
2
+
3
+ namespace basic {
4
+
5
+ void limits ();
6
+
7
+ }
Original file line number Diff line number Diff line change
1
+ #include < exercises/basic/limits.hpp>
2
+
3
+ #include < iostream>
4
+ #include < limits>
5
+
6
+ namespace basic {
7
+
8
+ void limits () {
9
+ std::cout << " type\t │ lowest()\t │ min()\t\t │ max()\n "
10
+ << " bool\t │ " << std::numeric_limits<bool >::lowest () << " \t\t │ "
11
+ << std::numeric_limits<bool >::min () << " \t\t │ "
12
+ << std::numeric_limits<bool >::max () << ' \n '
13
+ << " uchar\t │ " << +std::numeric_limits<unsigned char >::lowest ()
14
+ << " \t\t │ " << +std::numeric_limits<unsigned char >::min ()
15
+ << " \t\t │ " << +std::numeric_limits<unsigned char >::max () << ' \n '
16
+ << " int\t │ " << std::numeric_limits<int >::lowest () << " \t │ "
17
+ << std::numeric_limits<int >::min () << " \t │ "
18
+ << std::numeric_limits<int >::max () << ' \n '
19
+ << " float\t │ " << std::numeric_limits<float >::lowest () << " \t │ "
20
+ << std::numeric_limits<float >::min () << " \t │ "
21
+ << std::numeric_limits<float >::max () << ' \n '
22
+ << " double\t │ " << std::numeric_limits<double >::lowest () << " \t │ "
23
+ << std::numeric_limits<double >::min () << " \t │ "
24
+ << std::numeric_limits<double >::max () << ' \n ' ;
25
+ }
26
+ } // namespace basic
Original file line number Diff line number Diff line change
1
+ #include < catch2/catch_test_macros.hpp>
2
+
3
+ #include < exercises/basic/limits.hpp>
4
+
5
+ TEST_CASE (" limits" , " [basic]" ) { basic::limits (); }
You can’t perform that action at this time.
0 commit comments