Skip to content

Commit e7d0f6b

Browse files
committed
add f64_square helper function
1 parent 674ef18 commit e7d0f6b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

FprimeZephyrReference/Components/Drv/Helpers/Helpers.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,8 @@ F64 sensor_value_to_f64(const struct sensor_value& val) {
1313
return val.val1 + (val.val2 / 1000000.0f);
1414
}
1515

16+
F64 f64_square(float num) {
17+
return num * num;
18+
}
19+
1620
} // namespace Drv

FprimeZephyrReference/Components/Drv/Helpers/Helpers.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ namespace Drv {
1414
//! Convert a Zephyr sensor_value to an Fprime F64
1515
F64 sensor_value_to_f64(const struct sensor_value& val);
1616

17+
//! Square a float
18+
F64 f64_square(float num);
19+
1720
} // namespace Drv
1821

1922
#endif

0 commit comments

Comments
 (0)