# Exercise: Square Roots
#
# The `fmath.sqrt` function calculates the square root.
#
# Examples:
#   4.0 fmath.sqrt     # 2.0
#   9.0 fmath.sqrt     # 3.0
#   2.0 fmath.sqrt     # ~1.414...
#
# Your task: Use square roots in calculations
#
# When done, delete the marker line below.

use std:fmath

# I AM NOT DONE

: test-sqrt-perfect ( -- )
    25.0 fmath.sqrt

    # Do not edit below this line
    5.0 f.= test.assert
;

: test-sqrt-100 ( -- )
    # Calculate sqrt of 100
    # Your code here
    0.0

    # Do not edit below this line
    10.0 f.= test.assert
;

: hypotenuse ( Float Float -- Float )
    # Calculate hypotenuse: sqrt(a^2 + b^2)
    # Your code here
    drop drop 0.0
;

: test-hypotenuse ( -- )
    3.0 4.0 hypotenuse

    # Do not edit below this line
    5.0 f.= test.assert
;
