Files
2nd/10_Wiki/Dev/Topic_CSharp/CSharp_Operators_Comparison.md
T
Antigravity Agent 1cfd3bbb56 docs(10_Wiki): 위키 구조 정리 — 언어 튜토리얼 카테고리 폴더 제거 + 신규 자산 동기화
Topic_CSS/Topic_HTML/Topic_JavaScript/Topic_Prompt/Topic_Comfyui 등 기존 카테고리 폴더를 정리하고,
Topic_Graphic/Dev 등 신규 산출물과 Topics 내부 세션/메모리 기록을 동기화.
2026-07-05 00:10:59 +09:00

3.4 KiB

id, title, category, status, verification_status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, created_at, updated_at, review_reason, merge_history, tags, raw_sources, applied_in, github_commit
id title category status verification_status canonical_id aliases duplicate_of source_trust_level confidence_score created_at updated_at review_reason merge_history tags raw_sources applied_in github_commit
csharp-operators-comparison C# Comparison Operators Programming_Language draft conceptual
== != > < C#
C# 비교 연산자
B 0.83 2026-07-04 2026-07-04
csharp
programming-language
w3schools
operators
comparison
https://www.w3schools.com/cs/cs_operators_comparison.php

CSharp Comparison Operators

🎯 한 줄 통찰 (One-line insight)

C#'s comparison operators return a genuine bool value (True/False), not C's convention of 1/0 integers standing in for truth — this is a direct, visible consequence of the Data Types chapter's earlier finding that bool is a real first-class type in C# (unlike classic C, where comparisons are just int expressions), so Console.WriteLine(x > y); prints the WORD "True", something a raw C comparison expression could never do without an explicit ? "true" : "false" ternary. [S1]

🧠 핵심 개념 (Core concepts)

  • == — equal to. [S1]
  • != — not equal. [S1]
  • > / < — greater than / less than. [S1]
  • >= / <= — greater than or equal to / less than or equal to. [S1]
  • Return type is bool — every comparison evaluates to a true bool value (True or False), not an integer. [S1]
  • Purpose — enables decision-making in code; foundational for the upcoming Conditions (if/else) chapters. [S1]

📖 세부 내용 (Details)

  • Direct example: int x = 5; int y = 3; Console.WriteLine(x > y); // returns True because 5 is greater than 3. [S1]

⚖️ 모순 및 업데이트 (Contradictions & updates)

  • 비교 결과가 진짜 bool 값으로 출력됨: C의 비교식은 사실 int(1 또는 0)를 반환하므로 printf로 직접 출력하면 1/0이 찍히지만, C#은 bool이 실질적인 타입이라 Console.WriteLine(x > y);가 "True"라는 단어 자체를 출력한다는 점이 확인됨 — Data Types 챕터에서 확인된 bool의 1급 타입 지위가 여기서 실제로 드러남. [S1]

🛠️ 적용 사례 (Applied in summary)

현재 발견된 실제 적용 사례가 없습니다 — x > y 비교 결과를 직접 출력하는 예제가 원문에서 제시됨. [S1]

💻 코드 패턴 (Code patterns)

Comparison operators return real bool values, printed as "True"/"False" (C#):

int x = 5;
int y = 3;
Console.WriteLine(x > y);  // "True"

검증 상태 및 신뢰도

  • 상태: draft
  • 검증 단계: conceptual
  • 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
  • 신뢰 점수: 0.83
  • 중복 검사 결과: 신규 생성 (New discovery)

🔗 지식 그래프 (Knowledge Graph)

📚 출처 (Sources)

📝 변경 이력 (Change history)

  • 2026-07-04: Initial draft synthesized from the W3Schools "C# Comparison Operators" page (Astra wiki-curation, P-Reinforce v3.1 format).