---
id: cpp-data-types-numeric
title: "C++ Numeric Data Types"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["float vs double", "scientific notation", "C++ 숫자 타입"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.85
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["cpp", "programming-language", "w3schools", "data-types", "numbers"]
raw_sources: ["https://www.w3schools.com/cpp/cpp_data_types_numeric.asp"]
applied_in: []
github_commit: ""
---

# [[CPP Numeric Data Types]]

## 🎯 한 줄 통찰 (One-line insight)
The exact same precision tradeoff from C reappears unchanged — `float` holds only 6-7 decimal digits while `double` holds ~15, and the source again recommends `double` as the SAFER default for most calculations — confirming C++'s floating-point model (and its associated precision caveats) is inherited directly from C, not redesigned. [S1]

## 🧠 핵심 개념 (Core concepts)
- **`int`** — whole numbers without decimals. [S1]
- **`float`** — decimal numbers, ~6-7 significant digits, 4 bytes. [S1]
- **`double`** — decimal numbers, ~15 significant digits, 8 bytes; recommended default for most calculations. [S1]
- **Scientific notation** — `e`/`E` means "times 10 to the power of" (e.g. `35e3` = 35000), same syntax as C. [S1]
- **No format specifier for printing** — `cout << myNum;` works identically for `int`, `float`, or `double`, unlike C's type-matched `%d`/`%f`/`%lf`. [S1]

## 📖 세부 내용 (Details)
- Basic declarations printed with plain `cout <<` (no type-specific specifier): `int myNum = 1000; cout << myNum;`, `float myNum = 5.75; cout << myNum;`, `double myNum = 19.99; cout << myNum;`. [S1]
- Scientific notation: `float f1 = 35e3; double d1 = 12E4; cout << f1; cout << d1;`. [S1]

## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **double을 기본으로 권장하는 것도 C와 동일**: float가 메모리를 절반만 쓰지만 대부분의 계산에는 정밀도가 더 높은 double을 쓰는 것이 더 안전하다는 조언이 C 챕터와 그대로 반복됨. [S1]

## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 과학적 표기법(35e3)으로 큰 수를 짧게 표현하는 패턴이 C 챕터와 동일하게 실전 활용된다. [S1]

## 💻 코드 패턴 (Code patterns)
Printing float/double/int values directly with cout, no format specifier needed (C++):
```cpp
float f1 = 35e3;   // 35 * 10^3 = 35000
double d1 = 12E4;  // 12 * 10^4 = 120000
cout << f1;
cout << d1;
```

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

## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[C++ Tutorial]]
- **관련 개념:** [[CPP Data Types]], [[CPP Data Types Bool]], [[C Data Types Numbers]]
- **참조 맥락:** 숫자 타입 — 불리언 타입(Data Types Bool) 챕터로 이어짐.

## 📚 출처 (Sources)
- [S1] W3Schools — C++ Numeric Data Types — https://www.w3schools.com/cpp/cpp_data_types_numeric.asp

## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "C++ Numeric Data Types" page (Astra wiki-curation, P-Reinforce v3.1 format).
