Module 3: Numbers & Coercion
ตัวเลขดูง่าย แต่คนที่รู้จริงเลือก type ก่อนเขียนสูตร — เพราะเลือกผิดแปลว่ายอดรวมผิด, เงินผิด, ผลลัพธ์ผิด
Learning Flow
Section titled “Learning Flow”Learning Goals
Section titled “Learning Goals”- แยกความแตกต่างระหว่าง integer กับ float ได้ — และรู้ว่าเมื่อไหร่ควรใช้แบบไหน
- อธิบาย floating-point problem ได้ — ทำไม 0.1 + 0.2 ไม่เท่ากับ 0.3
- ใช้ type casting และ parsing แปลง text ↔ number ได้ในทุกเครื่องมือ — และรู้วิธีจัดการ error
- เข้าใจ boolean logic ร่วมกับ NULL (Kleene logic) — และผลกระทบต่อการ filter ข้อมูล
Progress 0 / 4
ทุกบทเรียนมี 4 Try-It Blocks
Section titled “ทุกบทเรียนมี 4 Try-It Blocks”บทเรียน
Section titled “บทเรียน” 3.1 Integer vs Float ตัวเลข 2 ชนิดหลัก — เมื่อไหร่ใช้อะไร
3.2 The Floating-Point Problem ทำไม 0.1 + 0.2 ไม่เท่ากับ 0.3 — และวิธีป้องกัน
3.3 Casting and Parsing แปลง text เป็น number และกลับมา — อย่างปลอดภัย
3.4 Boolean & Filter Logic TRUE, FALSE, NULL — ทำไม filter ถึงให้ผลลัพธ์ไม่เท่าที่คิด
Lab: Active Students > 100 นับนักเรียน active ที่ราคา > 100 — แล้วดูว่า NULL เปลี่ยนคำตอบ