 
 ## Test code
 
-a = new LongInt(Stream.fromArray([499, 999, 999, 999]), -1)
-b = new LongInt(Stream.fromArray [501])
-c = new LongInt(Stream.fromArray [500, 999, 999, 999])
+a = new LongInt(-999999999499)
+b = new LongInt(501)
+c = new LongInt(999999999500)
 
 console.log "a   = #{a.toString('_')}"
 console.log "b   = #{b.toString('_')}"
 console.log "c   = #{c.toString('_')}"
+console.log "c   = #{c.toNumber()} (as number)"
 console.log "a+b = #{(a.plus b).toString('_')}"
 console.log "a-b = #{(a.minus b).toString('_')}"
+console.log "a-b = #{(a.minus b).toNumber()} (as number)"
 console.log "a-a = #{(a.minus a).toString('_')}"
 console.log "b-a = #{(b.minus a).toString('_')}"
 console.log "a+c = #{(a.plus c).toString('_')}"

  ZEROES = ('0' for i in [1..BLEN]).join ''
  Z = new Stream(0)

  constructor: (@digits, @sign = 1) ->

  neg: -> new LongInt(@digits, -@sign)

  plus: (other) ->
    add = (r, s, c = 0) ->


    if this.sign != other.sign
      this.plus other.neg()
    else if this.abs().cmp(other.abs()) < 0
      create(sub(other.digits, this.digits), -this.sign)
    else
      create(sub(this.digits, other.digits), this.sign)

  toString: (sep = '') ->
    rev = @digits.reverse().drop_while (d) -> d == 0
