开发者

Double.POSITIVE_INFINITY in C#

开发者 https://www.devze.com 2023-01-04 05:53 出处:网络
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 neg

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

精彩评论

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