mathnet / mathnet-numerics

Math.NET Numerics
http://numerics.mathdotnet.com
MIT License
3.51k stars 898 forks source link

Bug report #1096

Closed ibasin closed 1 month ago

ibasin commented 1 month ago

In Pow10 method there is an obvious bug. You are missing a minus sign. This is the code you have

private static float Pow10(int y)
{
    return -_negativePowersOf10.Length < y && y <= 0
        ? _negativePowersOf10[-y]
        : (float)Math.Pow(10.0, y); 
}

The last line should be: (float)Math.Pow(10.0, -y); //you are missing a minus sign

ibasin commented 1 month ago

Sorry, this is not a bug. My bad.