modified isNaN and divide by zero tests
added to/from double, modified invalidOperation fctns