Skip to content

Conversation

@JJL772
Copy link
Contributor

@JJL772 JJL772 commented Sep 28, 2024

Fixed exp2 and exp10 conversions. The value and constant parameters were swapped.

SENSOR_CONV_CUBE should be cube, not cube root.

SENSOR_CONV_CUBE_NEG1 should be cube root. The IPMI spec is not very clear on this, but it defines this conversion as $cube^{-1}(x)$

I've also substituted the pow for cbrt here because it is faster than pow(x, 1.0/3.0) (not that it matters :))

This fixes the issues seen with the Vadatech ATC807 switches and their vOut readout.

1 / 3 is integer math and evaluates to 0

cube root is equivalent to pow(value, 1.0 / 3.0), not pow(value -1/3)
@JJL772 JJL772 changed the title Fix cube and cube_neg1 sensor conversions Fix exp2, exp10, cube and cube_neg1 sensor conversions Sep 28, 2024
@JJL772 JJL772 force-pushed the pr-fix-sensor-convs branch from e179386 to 4490b78 Compare October 8, 2024 22:45
@JJL772 JJL772 force-pushed the pr-fix-sensor-convs branch from 4490b78 to 19c994f Compare October 8, 2024 22:45
@marciodo marciodo merged commit cfefb68 into pre-release Oct 8, 2024
@marciodo marciodo deleted the pr-fix-sensor-convs branch October 8, 2024 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants