   # @private
   #
   _displayValue: (value, negative) ->
-    value = '0' if value is ''
+    @error = error = @_isError value
+    value = '0' if value is '' or error
     value += '.' if value.indexOf('.') < 0
     value = value.replace /\./, @options.point
     @$element.find('.jscalc-display')

    $target = $(event.currentTarget)

    code = $target.data 'code'
    switch code
      when 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
        @_enterDigit code
      when '.'
        @_enterPoint()
      when '+/-'
        @_toggleSign()
      when 'DEL'
        @_deleteLastChar()
      when 'AC'
        @_allClear()
      when '+'
        @_calcPlusMinus true
      when '-'
        @_calcPlusMinus false
      when '*'
        @_calcMultDiv true
      when '/'
        @_calcMultDiv false
      when '%'
        @_calcUnaryOp (x1) -> x1 / 100
      when 'x^2'
        @_calcUnaryOp (x1) -> x1 * x1
      when 'sqrt'
        @_calcUnaryOp (x1) -> Math.sqrt x1
      when '1/x'
        @_calcUnaryOp (x1) -> 1 / x1
      when '='
        @_calcResult()

    false


  #
  _displayOutput: (value) ->
    negative = false
    unless @_isError value
      if value < 0
        negative = true
        value *= -1
      value = String(value)
    @_displayValue value, negative

  # Displays the given value with optional negative flag.
  #
