Details

(Made using r29635)

This plugin adds an Ohm's Law calculator feature to the resistor.c plugin. It takes two inputs, of either (voltage, resistance, current, power), but not both of the same time, it will then calculate the other two values.

Oh dear, I was looking at the file, and it appeared that I had three lines with tabs in there...I have fixed the problem and uploaded a new patch. I believe it can be applied with patch -p1 < 0001-Added-Ohm-s-Law-feature-to-resistor.c-plugin-patch

There are still some tabs in there :) Those are easy to fix though, and therefore not a real problem.

The only thing that bothers me a bit is that you use floating point types. While this does work in plugins, it's not something we really like (most of our players don't have floating point hardware). It's not a real problem in this case, since you only do very few calculations, so floating point emulation won't be too slow. It would still be nice if this could be done using only fixed point arithmetic though.