开发者

Double.POSITIVE_INFINITY in C#

Can i have a equivalent o generate a Java Double.POSITIVE_INFINITY 开发者_运维百科in C#?


Have you looked at double.PositiveInfinity? (aka System.Double.PositiveInfinity). The are similar values for negative infinity, NaN, epsilon (the smallest positive double) and min/max values.

It's a constant in the double struct. If that doesn't do what you want it to, please clarify.

Note that to test for infinity, you can use double.IsPositiveInfinity (and IsNegativeInfinity, and just IsInfinity).


Use the Double.PositiveInfinity constant. Example:

double huge = Double.PositiveInfinity;


There is Double.PositiveInfinity.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜