程式 (107 bytes)
ClrMemory : ? → A : ? → B : ? → C : – B ┘ ( 2 A → Y ◢ C – A Ans ² ◢ B ² – 4 A C → D ◢ ( √( D ) – B ) ┘ ( 2 A → B ◢ 2 Y – Ans → C ◢ Fix 0 : If √( D ) ≠ Rnd ( √( D : Then Y ◢ Lbl 1 : 1 M+ : √( D ÷ M → X : X ≠ Rnd( X ⇒ Goto 1 : X ┘ ( 2 A ◢ M : IfEnd : Norm 1
入Program教學:
使用教學
依次輸入 Ax2 + Bx + C = 0中的 A, B, C (三項)
顯示
1. Vertex 頂點 (x, y)
2. Discriminant 判別式 Δ
3. Two roots 兩個根 (In Decimal 小數)
If above roots are irrational number, 若以上解是無理數的話,
4. Two roots 兩個根 (In surd form 以根式表示) (p ± q √r)
例題
Find the coordinates of vertex and solve the equation of x2 + 6x + 3 = 0
求方程 x2 + 6x + 3 = 0 的頂點座標及解方程。
Vertex 頂點: (-3, -6), Roots 根: -3 ± √6
Find the number of roots for equation 3x2 - 4x + 9 = 0.
求方程 3x2 - 4x + 9 = 0 的根的數量。
The discriminsnt is -92 (< 0). The equation has no real roots
判別式為 -92 (< 0)。此方程沒有實數解。