0 -> 360 in some circumstances for correct calculation
765861
function fixHues(h1, h2) {
        var diff = Math.abs(NAMED_HUE_INDEX[h1] - NAMED_HUE_INDEX[h2]);
        if (diff !== 1 && diff !== 5) {
            return false;
        }

        var result = {
            h1: h1,
            h2: h2
        };
        if (h1 === 0 && h2 === 300) {
            result.h1 = 360;
        } else if (h2 === 0 && h1 === 300) {
            result.h2 = 360;
        }
        return result;
    }
621330
function(number, precision) {

    const multiplier = !!precision ? Math.pow(10, precision) : 1;

    return Math.round(number * multiplier) / multiplier;
  }
827754
function() {

      var a = this['re'];
      var b = this['im'];
      var ret = '';

      if (this['isNaN']()) {
        return 'NaN';
      }

      if (this['isZero']()) {
        return '0';
      }

      if (this['isInfinite']()) {
        return 'Infinity';
      }

      if (a !== 0) {
        ret += a;
      }

      if (b !== 0) {

        if (a !== 0) {
          ret += b < 0 ? ' - ' : ' + ';
        } else if (b < 0) {
          ret += '-';
        }

        b = Math.abs(b);

        if (1 !== b) {
          ret += b;
        }
        ret += 'i';
      }

      if (!ret)
        return '0';

      return ret;
    }
96600
function () {

			var low, high;

			if ( this.littleEndian ) {

				low = this.getUint32();
				high = this.getUint32();

			} else {

				high = this.getUint32();
				low = this.getUint32();

			}

			return high * 0x100000000 + low;

		}
1129289
private static double ulp(double dval, boolean subtracting)
	{
		long lbits = Double.doubleToLongBits(dval) & ~signMask;
		int binexp = (int) (lbits >>> expShift);
		double ulpval;
		if (subtracting && (binexp >= expShift) && ((lbits & fractMask) == 0L))
		{
			// for subtraction from normalized, powers of 2,
			// use next-smaller exponent
			binexp -= 1;
		}
		if (binexp > expShift)
		{
			ulpval = Double.longBitsToDouble(((long) (binexp - expShift)) << expShift);
		}
		else if (binexp == 0)
		{
			ulpval = Double.MIN_VALUE;
		}
		else
		{
			ulpval = Double.longBitsToDouble(1L << (binexp - 1));
		}
		if (subtracting)
			ulpval = -ulpval;

		return ulpval;
	}
471365
function numClose(x, y) {
  return (Number.isNaN(x) && Number.isNaN(y)) ||
    Math.abs(x - y) <= 1e-7;
}
784758
function(x,y){
        var _lsw = (x&0xFFFF)+(y&0xFFFF),
            _msw = (x>>16)+(y>>16)+(_lsw>>16);
        return (_msw<<16)|(_lsw&0xFFFF);
    }
902611
def dec2hms(x):
    
    if not np.isfinite(x):
        return 'XX:XX:XX.XX'
    # wrap negative RA's
    if x < 0:
        x += 360
    x /= 15.0
    h = int(x)
    x = (x - h) * 60
    m = int(x)
    s = (x - m) * 60
    return '{0:02d}:{1:02d}:{2:05.2f}'.format(h, m, s)
1046440
function (degrees) {
            var sign,
                temp,
                d,
                m,
                s;

            sign = degrees < 0 ? -1 : 1;
            temp = sign * degrees;
            d = Math.floor(temp);
            temp = (temp - d) * 60;
            m = Math.floor(temp);
            temp = (temp - m) * 60;
            s = Math.round(temp);

            if (s == 60) {
                m++;
                s = 0;
            }
            if (m == 60) {
                d++;
                m = 0;
            }

            return (sign == -1 ? "-" : "") + d + "\u00B0" + " " + m + "\u2019" + " " + s + "\u201D";
        }
567086
def numprop(value, propertyexpected):
    
    if propertyexpected == 'triangular':
        x = (math.sqrt(8 * value + 1) - 1) / 2
        return bool(x - int(x) > 0)
    elif propertyexpected == 'square':
        return math.sqrt(value).is_integer()
    elif propertyexpected == 'cube':
        x = value**(1 / 3)
        x = int(round(x))
        return bool(x**3 == value)
    elif propertyexpected == 'even':
        return value % 2 == 0
    elif propertyexpected == 'odd':
        return not value % 2 == 0
    elif propertyexpected == 'positive':
        return bool(value > 0)
    elif propertyexpected == 'negative':
        return bool(value < 0)
    elif propertyexpected == 'zero':
        return bool(value == 0)
1201068
def radang(x, y):
    ''''''
    if x == 0:
        if y == 0:
            return 0, 0
        return abs(y), 90+180*(y<0)
    if y == 0:
        return abs(x), 180*(x<0)

    r = math.sqrt(x*x+y*y)
    a = math.degrees(math.atan(y/x))
    if x < 0:
        a += 180
    elif y < 0:
        a += 360
    return r, a
151422
function (value, precision, mode) {
            /* jshint -W016 */
            /* jshint -W018 */

            // Helper variables
            var base, floorNum, isHalf, sign;

            // Making sure precision is integer
            precision |= 0;
            base = Math.pow(10, precision);
            value *= base;

            // Sign of the number
            sign     = (value > 0) | -(value < 0);
            isHalf   = value % 1 === 0.5 * sign;
            floorNum = Math.floor(value);

            if (isHalf) {
                mode = mode ? mode.toUpperCase() : "DEFAULT";
                switch (mode) {
                    case "DOWN":
                        // Rounds .5 toward zero
                        value = floorNum + (sign < 0);
                        break;
                    case "EVEN":
                        // Rouds .5 towards the next even integer
                        value = floorNum + (floorNum % 2 * sign);
                        break;
                    case "ODD":
                        // Rounds .5 towards the next odd integer
                        value = floorNum + !(floorNum % 2);
                        break;
                    default:
                        // Rounds .5 away from zero
                        value = floorNum + (sign > 0);
                }
            }

            return (isHalf ? value : Math.round(value)) / base;
            /* jshint +W016 */
            /* jshint +W018 */
        }
409114
function checkPrecision(val, base) {
  val = Math.round(Math.abs(val));
  return isNaN(val)? base : val;
}
1231773
function(value, precision, base){
    var sizes =         ['Y','Z','E','P','T','G','M','k',''],
        fractionSizes = ['y','z','a','f','p','n','µ','m',''],
        total = sizes.length;

    base = base || 1000;
    precision = Math.pow(10, precision || 2);

    if (value === 0) return 0;

    if (value > 1) {
      while (total-- && (value >= base)) value /= base;
    }
    else {
      sizes = fractionSizes;
      total = sizes.length;
      while (total-- && (value < 1)) value *= base;
    }

    return (Math.round(value * precision) / precision) + sizes[total];
  }
811028
def c_avar(self):
        
        if self.b == -4:
            return 1.0
        elif self.b == -3:
            return 0.0
        elif self.b == -2:
            return -1.0
        elif self.b == -1:
            return -2.0
        elif self.b == 0:
            return -2.0
724844
def lon360to180(lon):
    
    if np.any(lon > 360.0) or np.any(lon < 0.0):
        print("Warning: lon outside expected range")
        lon = wraplon(lon)
    #lon[lon > 180.0] -= 360.0
    #lon180 = (lon+180) - np.floor((lon+180)/360)*360 - 180
    lon = lon - (lon.astype(int)/180)*360.0
    return lon
545405
def _nbOperations(n):
    
    if n < 2:
        return 0
    else:
        n0 = (n + 2) // 3
        n02 = n0 + n // 3
        return 3 * (n02) + n0 + _nbOperations(n02)