(function() {

  this.def_class('Number',DObject,function(__scope,__class){

    if(!this.__ctor__){this.__ctor__= function Number(){}; this.__ctor__.prototype = this.prototype; }

    this.prototype[".."] = function(other) {
      return new (__ctor(__scope.Range))(this, other, false);
    }; __method_added(this,"..");

    this.prototype["..."] = function(other) {
      return new (__ctor(__scope.Range))(this, other, true);
    }; __method_added(this,"...");

    this.prototype.to_s = function() {
      return this.toString();
    }; __method_added(this,"to_s");

    this.prototype.to_i = function() {
      return this;
    }; __method_added(this,"to_i");

    this.prototype.times = function(blk) {
      var i;
      i = 0;
      while (++i < this) {
        blk(i);
      }
      return this;
    }; __method_added(this,"times");

    this.prototype.upto = function(to, blk) {
      var i;
      i = this;
      while (i < to) {
        blk(i++);
      }
      return this;
    }; __method_added(this,"upto");

    this.prototype.round = function(precision) {
      var mult;
      if (precision == null) precision = 0;
      mult = __scope.Math.pow(10, precision);
      return __scope.Math.round(this * mult) / mult;
    }; __method_added(this,"round");

    this.prototype.floor = function(precision) {
      var mult;
      if (precision == null) precision = 0;
      mult = __scope.Math.pow(10, precision);
      return __scope.Math.floor(this * mult) / mult;
    }; __method_added(this,"floor");

    this.prototype.ceil = function(precision) {
      var mult;
      if (precision == null) precision = 0;
      mult = __scope.Math.pow(10, precision);
      return __scope.Math.ceil(this * mult) / mult;
    }; __method_added(this,"ceil");

  });

}).call($$base);

