JS Built-ins
← Math38 / 215
MathSQRT2intermediate

Math.SQRT2 β€” squared equals 2

πŸ“– Usage Example
// Square root of 2
Math.SQRT2              // β†’ 1.4142135623...
Math.SQRT2 === Math.sqrt(2)   // β†’ true

Use Math.SQRT2 as a precomputed constant equal to √2, useful in geometry and diagonal calculations.

Math.SQRT2

By definition, (√2)² = 2. So Math.SQRT2 * Math.SQRT2 should be approximately 2.

Challenge: Verify that squaring Math.SQRT2 gives 2.

πŸ’‘ Hints (2)
  • β€’ (√2)Β² = 2 by definition.
  • β€’ Floating-point arithmetic may introduce a tiny error.