C# Single IsNegativeInfinity

Description

Single IsNegativeInfinity returns a value indicating whether the specified number evaluates to negative infinity.

Syntax

Single.IsNegativeInfinity has the following syntax.


public static bool IsNegativeInfinity(
  float f
)

Parameters

Single.IsNegativeInfinity has the following parameters.

  • f - A single-precision floating-point number.

Returns

Single.IsNegativeInfinity method returns true if f evaluates to NegativeInfinity; otherwise, false.

Example

The following code example demonstrates the IsNegativeInfinity method.


/*from  www .j  a  v  a  2 s.  c  o  m*/
using System;
public class MainClass{
  public static void Main(String[] argv){  
    // This will return true.
    Console.WriteLine("IsNegativeInfinity(-5.0F / 0) == {0}.", 
                   Single.IsNegativeInfinity(-5.0F / 0) ? "true" : "false");

  }
}
    

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version