Decimal.GreaterThanOrEqual(Decimal, Decimal) 연산자
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
public:
static bool operator >=(System::Decimal d1, System::Decimal d2);
public:
static bool operator >=(System::Decimal d1, System::Decimal d2) = System::Numerics::IComparisonOperators<System::Decimal, System::Decimal, bool>::op_GreaterThanOrEqual;
public static bool operator >=(decimal d1, decimal d2);
static member ( >= ) : decimal * decimal -> bool
Public Shared Operator >= (d1 As Decimal, d2 As Decimal) As Boolean
매개 변수
- d1
- Decimal
비교할 첫 번째 값입니다.
- d2
- Decimal
비교할 두 번째 값입니다.
반품
구현
설명
메서드는 GreaterThanOrEqual 값에 대해 크거나 같은 연산자의 연산을 Decimal 정의합니다. 다음과 같은 코드를 사용할 수 있습니다.
using System;
public class Example
{
public static void Main()
{
Decimal number1 = 16354.0699m;
Decimal number2 = 16354.0695m;
Console.WriteLine("{0} >= {1}: {2}", number1,
number2, number1 >= number2);
number1 = Decimal.Round(number1, 2);
number2 = Decimal.Round(number2, 2);
Console.WriteLine("{0} >= {1}: {2}", number1,
number2, number1 >= number2);
}
}
// The example displays the following output:
// 16354.0699 >= 16354.0695: True
// 16354.07 >= 16354.07: True
open System
let number1 = 16354.0699m
let number2 = 16354.0695m
printfn $"{number1} >= {number2}: {number1 >= number2}"
let rounded1 = Decimal.Round(number1, 2)
let rounded2 = Decimal.Round(number2, 2)
printfn $"{number1} >= {number2}: {number1 >= number2}"
// The example displays the following output:
// 16354.0699 >= 16354.0695: True
// 16354.07 >= 16354.07: True
Module Example
Public Sub Main()
Dim number1 As Decimal = 16354.0699d
Dim number2 As Decimal = 16354.0695d
Console.WriteLine("{0} >= {1}: {2}", number1,
number2, number1 >= number2)
number1 = Decimal.Round(number1, 2)
number2 = Decimal.Round(number2, 2)
Console.WriteLine("{0} >= {1}: {2}", number1,
number2, number1 >= number2)
End Sub
End Module
' The example displays the following output:
' 16354.0699 >= 16354.0695: True
' 16354.07 >= 16354.07: True
사용자 지정 연산자를 지원하지 않는 언어는 대신 메서드를 호출할 Compare 수 있습니다. 다음 예제와 같이 메서드를 GreaterThanOrEqual 직접 호출할 수도 있습니다.
Module Example
Public Sub Main()
Dim number1 As Decimal = 16354.0699d
Dim number2 As Decimal = 16354.0695d
Console.WriteLine("{0} >= {1}: {2}", number1, number2,
Decimal.op_GreaterThanOrEqual(number1, number2))
number1 = Decimal.Round(number1, 2)
number2 = Decimal.Round(number2, 2)
Console.WriteLine("{0} >= {1}: {2}", number1, number2,
Decimal.op_GreaterThanOrEqual(number1, number2))
End Sub
End Module
' The example displays the following output:
' 16354.0699 >= 16354.0695: True
' 16354.07 >= 16354.07: True
이 연산자에 해당하는 메서드는 다음과 같습니다. Decimal.Compare(Decimal, Decimal)