You can get precise values of these without depending on the compiler's ability to convert text to floating point values by saying
sys.float_info.min = System.BitConverter.Int64BitsToDouble(0x0010000000000000) # i.e. 2^-1023 sys.float_info.epsilon = System.BitConverter.Int64BitsToDouble(0x3cb0000000000000) # i.e. 2^-53 On Wed, May 8, 2013 at 8:10 AM, Jeff Hardy <[email protected]> wrote: > On Wed, May 8, 2013 at 4:07 AM, Markus Schaber <[email protected]>wrote: > >> Hi,**** >> >> ** ** >> >> http://www.johndcook.com/blog/2010/06/08/c-math-gotchas/ explains the >> problem: The double.MinValue and double.Epsilon in C# have different >> meanings thant DBL_MIN and DBL_EPSILON in C.**** >> >> ** ** >> >> I'm looking for a way how to get the wanted values… J >> > > So am I! .NET does not provide them as constants as far as I can tell. I'm > pretty sure .NET requires the use of IEEE-854 floats so they could probably > just be hardcoded to match the C constants but ... ick. Maybe there's a way > to calculate the C versions from what .NET provides? > > The relevant issue is https://ironpython.codeplex.com/workitem/27840. > > - Jeff > > _______________________________________________ > Ironpython-users mailing list > [email protected] > http://mail.python.org/mailman/listinfo/ironpython-users > >
_______________________________________________ Ironpython-users mailing list [email protected] http://mail.python.org/mailman/listinfo/ironpython-users
