IsFinite() equivalent
c#, c++
Solution
!double.IsInfinity(x) && !double.IsNaN(x)
References: http://pubs.opengroup.org/onlinepubs/009604499/functions/isfinite.html http://msdn.microsoft.com/en-us/library/system.double.isinfinity.aspx http://msdn.microsoft.com/en-us/library/system.double.isnan.aspx
Problem
What is the C# replacement for the following define? ``` #define IS_FINITE(x) (0x7FF0 != (*((unsigned short*)(&x) + 3) & 0x7FF0)) ``` Maybe `double.IsInfinity(x) == false` or `double.IsNegativeInfinity(x) == false`? Thanks.