types and parsers for epoch time and absolute DateTime

your suggestion gave the idea for the fix.

    def e(o:Int):Long = {
      require(o > 0)
      List.fill(o)(10).foldLeft(1)({_*_})
    }

    def f(n:Long,o:Int):Long = o match {
      case o if (o == 0) => n
      case o if (o > 0) => n*e(o)
      case o if (o < 0) => n/e(-o)
    }

no need for Double or Math.pow at all. (I'll replace e with an array lookup, no need to compute the foldLeft every time.)