C# Single LessThanOrEqual

Description

Single LessThanOrEqual returns a value that indicates whether a specified Single value is less than or equal to another specified Single value.

Syntax

Single.LessThanOrEqual has the following syntax.


public static bool operator <=(
  float left,
  float right
)

Parameters

Single.LessThanOrEqual has the following parameters.

  • left - The first value to compare.
  • right - The second value to compare.

Returns

Single.LessThanOrEqual method returns true if left is less than or equal to right; otherwise, false.

Example

The LessThanOrEqual method defines the operation of the less-than-or-equal operator for Single values.


// www. ja v  a 2s .  c  o m
using System;
public class MainClass{
  public static void Main(String[] argv){  
    float f1 = 1.2F;
    float f2 = 1.2F;
    Console.WriteLine(f1 <= f2);
  }
}

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