Where do I find the machine epsilon in C#?

前端 未结 5 1904
暖寄归人
暖寄归人 2020-12-29 08:01

The machine epsilon is canonically defined as the smallest number which added to one, gives a result different from one.

There is a Double.Epsilon but t

5条回答
  •  失恋的感觉
    2020-12-29 08:43

    LAPACK + DLAMCH, 64-bit INTEL processor, C#:

    var pp = double.Epsilon; // pp = 4.94065645841247E-324
    double p = NativeMethods.MachinePrecision('S'); // =DLAMCH('S') 
    p = 2.2250738585072014E-308
    double.MinValue = -1.7976931348623157E+308
    double.MaxValue =  1.7976931348623157E+308
    

提交回复
热议问题