if (isNaN(result)) result = 'ERROR: Answer is not a number!'; else if(result == undefined) result = 'ERROR: Calcule is falied!';