File tree 3 files changed +37
-25
lines changed
3 files changed +37
-25
lines changed Original file line number Diff line number Diff line change
1
+ /* *
2
+ * @file calc.cpp
3
+ * @author Seiichi Horie
4
+ * @brief Demonstration class implementation.
5
+ * @version 0.1
6
+ * @date 2022-Oct-31
7
+ *
8
+ * @copyright (c) Seiichi Horie 2024
9
+ *
10
+ */
11
+
1
12
#include " calc.hpp"
13
+
2
14
#include < assert.h>
3
15
4
- double Calc::sqrt (double param)
5
- {
6
- assert (param >= 0 );
16
+ double Calc::sqrt (double param) {
17
+ assert (param >= 0 );
7
18
8
- return std::sqrt (param);
19
+ return std::sqrt (param);
9
20
}
Original file line number Diff line number Diff line change 1
1
/* *
2
2
* @file calc.hpp
3
- * @author your name (you@domain.com)
4
- * @brief
3
+ * @author Seiichi Horie
4
+ * @brief Demonstration class.
5
5
* @version 0.1
6
- * @date 2022-01-22
6
+ * @date 2022-Oct-31
7
7
*
8
- * @copyright Copyright (c) 2022
8
+ * @copyright (c) Seiichi Horie 2024
9
9
*
10
10
*/
11
11
#include < cmath>
14
14
* @brief Test struct
15
15
*
16
16
*/
17
- struct Calc
18
- {
19
- /* *
20
- * @brief Calcurate the square root
21
- *
22
- * @param param Must be positive or zero.
23
- * @return double square root of param
24
- */
25
- double sqrt (double param);
17
+ struct Calc {
18
+ /* *
19
+ * @brief Calculate the square root
20
+ *
21
+ * @param param Must be positive or zero.
22
+ * @return double square root of param
23
+ */
24
+ double sqrt (double param);
26
25
};
Original file line number Diff line number Diff line change 1
1
/* *
2
2
* @file main.cpp
3
- * @author your name (you@domain.com)
4
- * @brief
3
+ * @author Seiichi Horie
4
+ * @brief Pico/Win-Unix Bi-modal program.
5
5
* @version 0.1
6
- * @date 2022-01-22
7
- *
8
- * @copyright Copyright (c) 2022
6
+ * @date 2024-Oct-31
9
7
*
8
+ * @copyright (c) Seiichi Horie 2024
10
9
*/
11
10
#if __has_include(<pico/stdlib.h>)
12
11
#include < pico/stdlib.h>
@@ -46,9 +45,12 @@ int main() {
46
45
}
47
46
#endif
48
47
49
- // count from 1 to num
50
- for (int i = 1 ; i <= 10 ; i++)
51
- printf (" [CalcSqrt] The square root of %d is %f \n " , i, calc.sqrt (i));
48
+ // Write user code here.
49
+ {
50
+ // count from 1 to num
51
+ for (int i = 1 ; i <= 10 ; i++)
52
+ printf (" [CalcSqrt] The square root of %d is %f \n " , i, calc.sqrt (i));
53
+ }
52
54
53
55
#if __has_include(<pico/stdlib.h>) // Is target pico/Pico2?
54
56
// tell user we have finished.
You can’t perform that action at this time.
0 commit comments