JavaScript example uses NAN to check user input. Also checks range.
JavaScipt Loan Calculator.
JavaScript example that determines triangle type.