Skip to content

Commit 0c98325

Browse files
committed
Code clean up from Loic
1 parent d674116 commit 0c98325

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

python-bindings/overview_article/cmult.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ float cmult(int int_param, float float_param) {
66
float return_value = int_param * float_param;
77
printf(" In cmult : int: %d float %.1f returning %.1f\n", int_param,
88
float_param, return_value);
9-
return int_param * float_param;
9+
return return_value;
1010
}
1111

python-bindings/overview_article/cppmult.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44

55
float cppmult(int int_param, float float_param) {
66
float return_value = int_param * float_param;
7-
printf(" In cppmul: int: %d float %.1f returning %.1f\n", int_param,
8-
float_param, return_value);
9-
return int_param * float_param;
7+
std::cout << std::setprecision(1) << std::fixed
8+
<< " In cppmul: int: " << int_param
9+
<< " float " << float_param
10+
<< " returning " << return_value
11+
<< std::endl;
12+
return return_value;
1013
}
1114

0 commit comments

Comments
 (0)