Files
2nd/10_Wiki/Topics/Domain_Programming/Topic_JavaScript/JavaScript_Math.md
T
Antigravity Agent c24165b8bc refactor(topics): 멀티 에이전트용 지식 재편 — _Common(공통 기본기) + Domain_* 구조
에이전트 8종(대화형/프로그래머 C·S/디자이너/설계자/기획자/QA/PD/PM)에게
[공통 기본 능력 + 롤별 Specialty] 2층으로 지식을 주입하기 위한 재분류.
문서 내용·포맷은 무수정, 폴더 이동만 (6,372개 문서 수 보존 확인).

- Topic_Programming → Domain_Programming (내부 구조 보존)
- Topic_Graphic → Domain_Design
- Topic_Business → Domain_Product
- Topic_General → Domain_General
- _Common 신설: Math(구 Topic_Math_Specialty), Reasoning(구 General/From_Thinking & Reasoning),
  Reasoning_Creativity(구 General/From_창의성), Communication(Poetic_Blog_Writing + From_writing)
- 타 도메인의 From_* 폴더는 유지 (출처 표기일 뿐, 이미 도메인에 맞게 분류된 문서)
- 빈 폴더 정리 (memory/procedures)
- 에이전트→폴더 매핑은 workspace의 .astra/agent-knowledge-map.json (9개 에이전트)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-11 11:05:56 +09:00

6.5 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
javascript-math JavaScript Math Frontend draft conceptual
Math object
Math.round
Math.PI
Math methods
Math.pow
Math.random
B 0.88 2026-06-23 2026-06-23
javascript
js
web
frontend
w3schools
math
numbers
https://www.w3schools.com/js/js_math.asp

JavaScript Math

🎯 한 줄 통찰 (One-line insight)

The JavaScript Math object provides mathematical constants (like Math.PI, Math.E) and methods (rounding, powers, roots, trig, min/max, random) that operate on numbers without needing to be instantiated. [S1]

🧠 핵심 개념 (Core concepts)

  • Math is a static object — it exposes constants and methods directly (e.g. Math.PI, Math.round(x)), not via instances. [S1]
  • Rounding familyround (nearest integer), ceil (up), floor (down), and trunc (integer part). [S1]
  • Math.sign(x) returns whether x is negative, null, or positive. [S1]
  • Powers and rootsMath.pow(x, y) is x to the power y; Math.sqrt(x) is the square root. [S1]
  • Math.abs(x) returns the absolute (positive) value. [S1]
  • TrigMath.sin(x) / Math.cos(x) take an angle in radians (convert from degrees with * Math.PI / 180). [S1]
  • Math.min() / Math.max() find the lowest / highest value in a list of arguments. [S1]
  • Math.random() returns a random number between 0 (inclusive) and 1 (exclusive). [S1]

🧩 추출된 패턴 (Extracted patterns)

  • Degrees → radians — multiply by Math.PI / 180 before passing to Math.sin/Math.cos. [S1]
  • Rounding choice — pick round/ceil/floor/trunc per the rounding behavior you need. [S1]
  • Min/max over a list — call Math.min(...)/Math.max(...) with multiple numeric arguments. [S1]

📖 세부 내용 (Details)

The Math Object — The Math object allows you to perform mathematical tasks on numbers. Unlike other objects, the Math object has no constructor; it is static and its methods and properties are accessed directly. [S1]

Math Properties (constants) — [S1]

Property Description
Math.E Returns Euler's number
Math.PI Returns PI
Math.SQRT2 Returns the square root of 2
Math.SQRT1_2 Returns the square root of 1/2
Math.LN2 Returns the natural logarithm of 2
Math.LN10 Returns the natural logarithm of 10
Math.LOG2E Returns base 2 logarithm of E
Math.LOG10E Returns base 10 logarithm of E

Math Methods — selected methods documented on the page: [S1]

Method Description
Math.round(x) Returns x rounded to its nearest integer
Math.ceil(x) Returns x rounded up to its nearest integer
Math.floor(x) Returns x rounded down to its nearest integer
Math.trunc(x) Returns the integer part of x
Math.sign(x) Returns if x is negative, null or positive
Math.pow(x, y) Returns the value of x to the power of y
Math.sqrt(x) Returns the square root of x
Math.abs(x) Returns the absolute (positive) value of x
Math.sin(x) Returns the sine of the angle x
Math.cos(x) Returns the cosine of the angle x
Math.min() Can be used to find the lowest value in a list
Math.max() Can be used to find the highest value in a list
Math.random() Returns a random number between 0 (inclusive), and 1 (exclusive)
Math.log(x) Returns the natural logarithm of x
Math.log2(x) Returns the base 2 logarithm of x
Math.log10(x) Returns the base 10 logarithm of x

Example expressions and their results — as shown on the page: [S1]

Expression Result
Math.round(4.6) 5
Math.round(4.5) 4
Math.round(4.4) 4
Math.ceil(4.9) 5
Math.floor(4.9) 4
Math.trunc(4.9) 4
Math.sign(-4) -1
Math.pow(8, 2) 64
Math.sqrt(64) 8
Math.abs(-4.7) 4.7
Math.sin(90 * Math.PI / 180) 1
Math.cos(0 * Math.PI / 180) 1
Math.min(0, 150, 30, 20, -8, -200) -200
Math.max(0, 150, 30, 20, -8, -200) 150
Math.random() A number between 0 (inclusive) and 1 (exclusive)

Note: The full source presents these expressions inside interactive "Try it Yourself" Example boxes. The expressions and results above are reproduced from the page; any code that exists only inside the Try-it editor without a printed expression is "Not found in source".

🛠️ 적용 사례 (Applied in summary)

The page's own snippets are the canonical applied examples — rounding 4.x values, computing Math.pow(8, 2), taking Math.sqrt(64), converting degrees to radians for Math.sin/Math.cos, and finding min/max over a list. No external project/commit applications found in the source.

💻 코드 패턴 (Code patterns)

Round to nearest / up / down / truncate:

Math.round(4.6);  // 5
Math.ceil(4.9);   // 5
Math.floor(4.9);  // 4
Math.trunc(4.9);  // 4

Power, square root, absolute value:

Math.pow(8, 2);   // 64
Math.sqrt(64);    // 8
Math.abs(-4.7);   // 4.7

Degrees to radians for trig:

Math.sin(90 * Math.PI / 180);  // 1
Math.cos(0 * Math.PI / 180);   // 1

Min / max over a list:

Math.min(0, 150, 30, 20, -8, -200);  // -200
Math.max(0, 150, 30, 20, -8, -200);  // 150

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

No contradictions found in the source.

검증 상태 및 신뢰도

  • 상태: draft
  • 검증 단계: conceptual (실제 적용 사례 발견 시 applied/validated로 승격 가능)
  • 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
  • 신뢰 점수: 0.88
  • 중복 검사 결과: 신규 생성 (New discovery)

🔗 지식 그래프 (Knowledge Graph)

📚 출처 (Sources)

📝 변경 이력 (Change history)

  • 2026-06-23: Initial draft synthesized from the W3Schools "JavaScript Math" page (Astra wiki-curation, P-Reinforce v3.1 format).