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
.
精彩评论