default scale 
Basic number structure
423988
function() {
        this.n_sign = null; // sign
        this.n_len = null;  /* (int) The number of digits before the decimal point. */
        this.n_scale = null; /* (int) The number of digits after the decimal point. */
        //this.n_refs = null; /* (int) The number of pointers to this number. */
        //this.n_text = null; /* ?? Linked list for available list. */
        this.n_value = null;  /* array as value, where 1.23 = [1,2,3] */
        this.toString = function() {
            var r, tmp;
            tmp=this.n_value.join('');

            // add minus sign (if applicable) then add the integer part
            r = ((this.n_sign == libbcmath.PLUS) ? '' : this.n_sign) + tmp.substr(0, this.n_len);

            // if decimal places, add a . and the decimal part
            if (this.n_scale > 0) {
                r += '.' + tmp.substr(this.n_len, this.n_scale);
            }
            return r;
        };

        this.setScale = function(newScale) {
            while (this.n_scale < newScale) {
                this.n_value.push(0);
                this.n_scale++;
            }
            while (this.n_scale > newScale) {
                this.n_value.pop();
                this.n_scale--;
            }
            return this;
        }

    }
1061268
function defaultStrategy(evt, { invert, maxScale, minScale }) {
  const deltaY = evt.detail.deltaPoints.page.y;
  const ticks = invert ? -deltaY / 100 : deltaY / 100;
  const { element, viewport } = evt.detail;
  const [startX, startY, imageX, imageY] = [
    evt.detail.startPoints.page.x,
    evt.detail.startPoints.page.y,
    evt.detail.startPoints.image.x,
    evt.detail.startPoints.image.y,
  ];

  // Calculate the new scale factor based on how far the mouse has changed
  const updatedViewport = changeViewportScale(viewport, ticks, {
    maxScale,
    minScale,
  });

  external.cornerstone.setViewport(element, updatedViewport);

  // Now that the scale has been updated, determine the offset we need to apply to the center so we can
  // Keep the original start location in the same position
  const newCoords = external.cornerstone.pageToPixel(element, startX, startY);

  // The shift we will use is the difference between the original image coordinates of the point we've selected
  // And the image coordinates of the same point on the page after the viewport scaling above has been performed
  // This shift is in image coordinates, and is designed to keep the target location fixed on the page.
  let shift = {
    x: imageX - newCoords.x,
    y: imageY - newCoords.y,
  };

  // Correct the required shift using the viewport rotation and flip parameters
  shift = correctShift(shift, updatedViewport);

  // Apply the shift to the Viewport's translation setting
  viewport.translation.x -= shift.x;
  viewport.translation.y -= shift.y;
}
1290694
function(numbers) {
    var stepsize = stepSize(numbers);
    if( !numbers ) {
      return { beginning: 'second', text: '' };
    }
    if( isEveryOther( stepsize, numbers ) ) {
      return { beginning: '', text: 'other second' };
    } else if( isStepValue( stepsize, numbers ) ) {
      return { beginning: '', text: stepsize + ' seconds' };
    } else {
      return { beginning: 'minute', text: 'starting on the ' + (numbers.length === 2 && stepsize === 30 ? 'first and 30th second' : numberList(numbers) + ' second') };
    }
  }
412034
def defaults(self):
		
		self.chart_style = {}
		self.chart_opts = {}
		self.style("color", "#30A2DA")
		self.width(900)
		self.height(250)
492970
def default_number_converter(number_str):
    
    is_int = (number_str.startswith('-') and number_str[1:].isdigit()) or number_str.isdigit()
    # FIXME: this handles a wider range of numbers than allowed by the json standard,
    # etc.: float('nan') and float('inf'). But is this a problem?
    return int(number_str) if is_int else float(number_str)
74761
def grouped_digits(digits)
      unless (digits.size % @base_scale) == 0
        raise "Invalid number of digits for group_digits (#{digits.size} is not a multiple of #{@base_scale})"
      end
      digits.each_slice(@base_scale).map{|group| scaled_digit(group)}
    end
538239
function bcscale(scale) {
    scale = parseInt(scale, 10);
    if (isNaN(scale)) {
        return false;
    }
    if (scale < 0) {
        return false;
    }
    libbcmath.scale = scale;
    return true;
}
1151200
def format_value(value,number_format):
    ""

    style,sufix,scale = decode_format(number_format)
    fmt = "{0:" + style + "}" + sufix

    return fmt.format(scale * value)
882677
def decimal_default(obj):
    """"""
    if isinstance(obj, decimal.Decimal):
        if obj % 1:
            return float(obj)
        return int(obj)
    raise TypeError
504919
function init(format = DEFAULT_FORMAT, locale = 'fr') {
    numeral.locale(locale);
    numeral.defaultFormat(format);
}
731892
function scale(scaleX) {
    var scaleY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scaleX;
    var imageData = this.imageData;


    scaleX = Number(scaleX);
    scaleY = Number(scaleY);

    if (this.viewed && !this.played && this.options.scalable) {
      var changed = false;

      if (isNumber(scaleX)) {
        imageData.scaleX = scaleX;
        changed = true;
      }

      if (isNumber(scaleY)) {
        imageData.scaleY = scaleY;
        changed = true;
      }

      if (changed) {
        this.renderImage();
      }
    }

    return this;
  }
556491
def _set_initial(self, C_in, scale_in):
        """
        self.C_in = C_in
        self.scale_in = scale_in
1167782
function () {

    // trim number to 3 decimals
    function dec3 (v) {
      return Math.floor(v * 1000) / 1000;
    }

    var params = [];
    var usingPreset = this.data.preset != 'none' ? this.presets[this.data.preset] : false;

    if (usingPreset) {
      params.push('preset: ' + this.data.preset);
    }

    for (var i in this.schema) {
      if (i == 'preset' || (usingPreset && usingPreset[i] === undefined)) {
        continue;
      }
      var def = usingPreset ? usingPreset[i] : this.schema[i].default;
      var data = this.data[i];
      var type = this.schema[i].type;
      if (type == 'vec3') {
        var coords = def;
        if (typeof(def) == 'string') {
          def = def.split(' ');
          coords = {x: def[0], y: def[1], z: def[2]};
        }
        if (dec3(coords.x) != dec3(data.x) || dec3(coords.y) != dec3(data.y) || dec3(coords.z) != dec3(data.z)) {
          params.push(i + ': ' + dec3(data.x) + ' ' + dec3(data.y) + ' ' + dec3(data.z));
        }
      }
      else {
        if (def != data) {
          if (this.schema[i].type == 'number') {
            data = dec3(data);
          }
          params.push(i + ': ' + data);
        }
      }
    }
    console.log('%c' + params.join('; '), 'color: #f48;font-weight:bold');
  }
394144
def expand_default(self, scale, discrete=(0, 0.6, 0, 0.6),
                       continuous=(0.05, 0, 0.05, 0)):
        
        if is_waive(scale.expand):
            if isinstance(scale, scale_discrete):
                return discrete
            elif isinstance(scale, scale_continuous):
                return continuous
            else:
                name = scale.__class__.__name__
                msg = "Failed to expand scale '{}'".format(name)
                raise PlotnineError(msg)
        else:
            return scale.expand
199727
def _scale_y_values(self, values, new_min, new_max, scale_old_from_zero=True):
        '''
        
        '''
        # Scale Y values - Create a scaled list of values to use for the visual graph
        scaled_values = []
        y_min_value = min(values)
        if scale_old_from_zero:
            y_min_value = 0
        y_max_value = max(values)
        new_min = 0
        OldRange = (y_max_value - y_min_value) or 1  # Prevents division by zero if all values are the same
        NewRange = (new_max - new_min)  # max_height is new_max
        for old_value in values:
            new_value = (((old_value - y_min_value) * NewRange) / OldRange) + new_min
            scaled_values.append(new_value)
        return scaled_values
297159
function(values) {
    var max = Number.MIN_VALUE,
        min = Number.MAX_VALUE,
        val,
        cc,
        attrs = {};

    if (!(this.scale instanceof jvm.OrdinalScale) && !(this.scale instanceof jvm.SimpleScale)) {
      if (!this.params.min || !this.params.max) {
        for (cc in values) {
          val = parseFloat(values[cc]);
          if (val > max) max = values[cc];
          if (val < min) min = val;
        }
        if (!this.params.min) {
          this.scale.setMin(min);
        }
        if (!this.params.max) {
          this.scale.setMax(max);
        }
        this.params.min = min;
        this.params.max = max;
      }
      for (cc in values) {
        val = parseFloat(values[cc]);
        if (!isNaN(val)) {
          attrs[cc] = this.scale.getValue(val);
        } else {
          attrs[cc] = this.elements[cc].element.style.initial[this.params.attribute];
        }
      }
    } else {
      for (cc in values) {
        if (values[cc]) {
          attrs[cc] = this.scale.getValue(values[cc]);
        } else {
          attrs[cc] = this.elements[cc].element.style.initial[this.params.attribute];
        }
      }
    }

    this.setAttributes(attrs);
    jvm.$.extend(this.values, values);
  }
1164818
public void normalizeScale() {
		double sum = 0;

		sum += SpecializedOps_DDRM.elementSumSq(T1);
		sum += SpecializedOps_DDRM.elementSumSq(T2);
		sum += SpecializedOps_DDRM.elementSumSq(T3);

		double n = Math.sqrt(sum);

		CommonOps_DDRM.scale(1.0/n,T1);
		CommonOps_DDRM.scale(1.0/n,T2);
		CommonOps_DDRM.scale(1.0/n,T3);
	}