Skip to content

Commit 4fd4873

Browse files
authored
Merge pull request #3 from FranzAlbers/fix/double-float-conversion
Fixed type conversions: Removed unnecessary float to double conversion
2 parents d9e9a42 + b0fc591 commit 4fd4873

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

adma_ros2_driver/include/adma_ros2_driver/parser/parser_utils.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include <iostream>
44

5-
const float PI=3.1415926535897932384626433832795028841971f;
5+
const double PI=3.1415926535897932384626433832795028841971;
66

77
bool getbit(unsigned char byte, int position);
8-
float getScaledValue(int32_t rawValue, float lsbFactor);
8+
double getScaledValue(int32_t rawValue, double lsbFactor);

adma_ros2_driver/src/parser/parser_utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ bool getbit(unsigned char byte, int position) // position in range 0-7
1010
return (byte >> position) & 0x1;
1111
}
1212

13-
float getScaledValue(int32_t rawValue, float lsbFactor)
13+
double getScaledValue(int32_t rawValue, double lsbFactor)
1414
{
15-
return rawValue * lsbFactor;
15+
return double(rawValue) * lsbFactor;
1616
}

0 commit comments

Comments
 (0)