Let's say I have a set of float
numbers, each with an int
value of Significant Figures.
What is the simplest and fastest C# method to find the minimum significant step (as a power of 10) for each value?
Value | Significant Figures | Expected Result |
---|---|---|
1.0123 | 3 | 0.01 |
1.0123 | 4 | 0.001 |
4525 | 2 | 100 |
0.007589 | 1 | 0.001 |
42 | 1 | 10 |
*In bold it's marked the Significant Figures of each Value.
I am tempted to use Math.Log10()
somehow, but I cannot yet figure out how.