 # Here are the beginnings of the `LongInt` class.
 
 class LongInt
-  make_digits = (m) ->
-    if m then seq.conj m % BASE, -> make_digits (m / BASE) >> 0 else null
-
-  constructur: (n = 0) ->
-    [m, @sign] = if n < 0 then [-n, -1] else [n, 1]
-    @digits = make_digits m
-
-  times: (other) ->
+  constructor: (@sign = 0, @digits = null) ->
+
+  times: (other) -> throw new Error "not yet implemented"
 
   zeroes = BASE.toString()[1..]
 


  sgn: -> if @val < 0 then -1 else if @val > 0 then 1 else 0

  sqrt: -> new CheckedInt Math.sqrt(@val) >> 0

  cmp: (other) ->
    x = getval other
    if @val < x then -1 else if @val > x then 1 else 0

  plus: (other) -> yield @val + getval other

  minus: (other) -> yield @val - getval other

  times: (other) ->
    tmp = @val * getval other
    if Math.abs(tmp) < BASE
      new CheckedInt tmp
    else
      new LongInt(@val).times other

  div: (other) -> new CheckedInt (@val / getval other) >> 0

  mod: (other) -> new CheckedInt @val % getval other


# A generic number type, currently supporting integral Javascript numbers,
# arbitrary precision integers and fractions.
#
# Arguments and results of arithmetic operations are coerced to the best
