docs: Add math section to syntax reference + improve example comments

- five-syntax-en/ko: Add Math comparison table (Harbour RTL vs Go math)
- go_math_compare.prg: Detailed English comments explaining each section
- Example lists updated with go_math_compare.prg

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-31 11:31:44 +09:00
parent 0828d17159
commit c0f175883c
3 changed files with 89 additions and 7 deletions

View File

@@ -1,12 +1,25 @@
// Five Math Comparison: Harbour RTL vs Go math package
// Five Math Comparison: Harbour RTL vs Go math Package
//
// Five has BOTH:
// 1. Harbour built-in: Abs(), Sqrt(), Round(), Int(), Max(), Min(), Log(), Exp(), Mod()
// 2. Go math package: math.Sqrt(), math.Sin(), math.Cos(), math.Pow(), math.Pi, ...
// Five gives you BOTH math systems in ONE file:
//
// Harbour RTL = simple, familiar.
// Go math = complete, IEEE 754 precise, 60+ functions.
// Five = use BOTH in the same PRG file!
// Harbour RTL (9 functions):
// Abs(), Sqrt(), Round(), Int(), Max(), Min(), Log(), Exp(), Mod()
// - Familiar to every xBase developer
// - No IMPORT needed, always available
// - Perfect for business calculations
//
// Go math package (60+ functions):
// math.Sin(), math.Cos(), math.Pow(), math.Pi, math.Hypot(), ...
// - Full IEEE 754 precision
// - Trigonometry, statistics, special values
// - Just add IMPORT "math"
//
// Why this matters:
// - Daily work: use Harbour RTL (shorter, simpler)
// - Scientific/financial: use Go math (complete, precise)
// - Mix both freely in the same function!
//
// This example compares them side-by-side and shows combined usage.
IMPORT "math"