Education Technology

Solution 40230: Python on TI-Nspire CX Family Software gives different answer then TI-Nspire CX II Family Calculator.

Why does Python on TI-Nspire CX Family software give a different answer then the TI-Nspire CX II Family calculator?

When evaluating the same expressions in Python using the math library, different math answers might be observed between TI-Nspire CX Family Software and TI-Nspire CX II Family Calculator. 

This issue is caused by the different math libraries used. The math module in Python uses different algorithms and number representations than the TI-Nspire.

For example:
import math
math.exp(1000000)
Calculator:1.797693134862316e+308
Software: ValueError: math domain error
pow(2,12)
Calculator:1.414213562373096
Software:1.414213562373095

To work around the above issue it is suggested to use the eval_function() from the ti_system library to evaluate, this will give the same result on software and calculator.