Represents the speed of the motor as a floating point value between -1
        (full speed backward) and 1 (full speed forward).
495908
def value(self):
        
        return (
            -self.enable_device.value
            if self.phase_device.is_active else
            self.enable_device.value
        )
645073
private double nextRadicalInverse() {
    counter++;
    // Do at most MAXFAST appromate steps
    if(counter >= MAXFAST) {
      counter = 0;
      inverse += MAXFAST;
      current = radicalInverse(inverse);
      return current;
    }
    // Fast approximation:
    double nextInverse = current + invbase;
    if(nextInverse < ALMOST_ONE) {
      current = nextInverse;
      return current;
    }
    else {
      double digit1 = invbase, digit2 = invbase * invbase;
      while(current + digit2 >= ALMOST_ONE) {
        digit1 = digit2;
        digit2 *= invbase;
      }
      current += (digit1 - 1.0) + digit2;
      return current;
    }
  }
1133360
def basis(self):
        
        precision_adj = self.dt / 100
        return np.arange(self.start, self.stop - precision_adj, self.dt)
1205757
def t_NUMBER(t):
    '
    exponents = {
            'G' : 30, 'g' : 30,
            'M' : 20, 'm' : 20,
            'K' : 10, 'k' : 10,
            }
    if t.value[-1] in exponents:
        t.value = math.ldexp(int(t.value[:-1]), exponents[t.value[-1]])
    else:
        t.value = int(t.value)
    return t
425375
def lerfcc(x):
    
    z = abs(x)
    t = 1.0 / (1.0+0.5*z)
    ans = t * math.exp(-z*z-1.26551223 + t*(1.00002368+t*(0.37409196+t*(0.09678418+t*(-0.18628806+t*(0.27886807+t*(-1.13520398+t*(1.48851587+t*(-0.82215223+t*0.17087277)))))))))
    if x >= 0:
        return ans
    else:
        return 2.0 - ans
272692
@Pure
	@Inline(value = "PhysicsUtil.getPhysicsEngine().speed(($1), ($2))",
			imported = {PhysicsUtil.class})
	public static double speed(double movement, double dt) {
		return engine.speed(movement, dt);
	}
774956
def to_native_units(self, motor):
        
        assert abs(self.rotations_per_second) <= motor.max_rps,\
            "invalid rotations-per-second: {} max RPS is {}, {} was requested".format(
            motor, motor.max_rps, self.rotations_per_second)
        return self.rotations_per_second/motor.max_rps * motor.max_speed
136099
public void setSpeed(float speed) {
		float currentSpeed = (float) Math.sqrt((velx*velx) + (vely*vely));
		velx *= speed;
		vely *= speed;
		velx /= currentSpeed;
		vely /= currentSpeed;
	}
253347
private static int getHighBit(int value) {
        if (value <= 0) {
            return -32;
        }

        int bit = 0;

        if (value >= 1 << 16) {
            value >>= 16;
            bit += 16;
        }

        if (value >= 1 << 8) {
            value >>= 8;
            bit += 8;
        }

        if (value >= 1 << 4) {
            value >>= 4;
            bit += 4;
        }

        if (value >= 1 << 2) {
            value >>= 2;
            bit += 2;
        }

        if (value >= 1 << 1) {
            bit += 1;
        }

        return bit;
    }
714200
public static double curveValue(double value, double dest, double speed)
    {
        Check.different(speed, 0.0);

        final double reciprocal = 1.0 / speed;
        final double invReciprocal = 1.0 - reciprocal;

        return value * invReciprocal + dest * reciprocal;
    }
790366
def right_motor(self, speed, durationS=-1.0):
        """"""
        if speed > 0:
            self.right_fwd(min(abs(speed), 255))
        else:
            self.right_rev(min(abs(speed), 255))
        if durationS > 0:
            self.board.sleep(durationS)
            self.left_stop()
828032
def decimal_to_dms(value, precision):
    '''
    
    '''
    deg = math.floor(value)
    min = math.floor((value - deg) * 60)
    sec = math.floor((value - deg - min / 60) * 3600 * precision)

    return ((deg, 1), (min, 1), (sec, precision))
1115369
function Fe(ct,pt,ut,bt){var kt=ct.c,It=Re,ht,mt,yt,_t,vt,xt,St;// if x is not Infinity or NaN...
if(kt){// rd is the rounding digit, i.e. the digit after the digit that may be rounded up.
// n is a base 1e14 number, the value of the element of array x.c containing rd.
// ni is the index of n within x.c.
// d is the number of digits of n.
// i is the index of rd within n including leading zeros.
// j is the actual index of rd within n (if < 0, rd is a leading zero).
out:{// Get the number of digits of the first element of xc.
for(ht=1,_t=kt[0];10<=_t;_t/=10,ht++);// If the rounding digit is in the first element of xc...
if(mt=pt-ht,0>mt)mt+=Pe,yt=pt,vt=kt[xt=0],St=0|vt/It[ht-yt-1]%10;else if(xt=ve((mt+1)/Pe),!(xt>=kt.length)){// Get the number of digits of n.
for(vt=_t=kt[xt],ht=1;10<=_t;_t/=10,ht++);// Get the index of rd within n.
mt%=Pe,yt=mt-Pe+ht,St=0>yt?0:0|vt/It[ht-yt-1]%10}else if(bt){// Needed by sqrt.
for(;kt.length<=xt;kt.push(0));vt=St=0,ht=1,mt%=Pe,yt=mt-Pe+1}else break out;if(bt=bt||0>pt||// Are there any non-zero digits after the rounding digit?
// The expression  n % pows10[ d - j - 1 ]  returns all digits of n to the right
// of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
null!=kt[xt+1]||(0>yt?vt:vt%It[ht-yt-1]),bt=4>ut?(St||bt)&&(0==ut||ut==(0>ct.s?3:2)):5<St||5==St&&(4==ut||bt||6==ut&&// Check whether the digit to the left of the rounding digit is odd.
1&(0<mt?0<yt?vt/It[ht-yt]:0:kt[xt-1])%10||ut==(0>ct.s?8:7)),1>pt||!kt[0])return kt.length=0,bt?(pt-=ct.e+1,kt[0]=It[(Pe-pt%Pe)%Pe],ct.e=-pt||0):kt[0]=ct.e=0,ct;// Remove excess digits.
// Round up?
if(0==mt?(kt.length=xt,_t=1,xt--):(kt.length=xt+1,_t=It[Pe-mt],kt[xt]=0<yt?Se(vt/It[ht-yt]%It[yt])*_t:0),bt)for(;;)// If the digit to be rounded up is in the first element of xc...
if(0==xt){// i will be the length of xc[0] before k is added.
for(mt=1,yt=kt[0];10<=yt;yt/=10,mt++);for(yt=kt[0]+=_t,_t=1;10<=yt;yt/=10,_t++);// if i != k the length has increased.
mt!=_t&&(ct.e++,kt[0]==Ee&&(kt[0]=1));break}else{if(kt[xt]+=_t,kt[xt]!=Ee)break;kt[xt--]=0,_t=1}// Remove trailing zeros.
for(mt=kt.length;0===kt[--mt];kt.pop());}// Overflow? Infinity.
ct.e>Qe?ct.c=ct.e=null:ct.e<Ze&&(ct.c=[ct.e=0])}return ct}
139304
def float2int(x):
    
    if not pd.isnull(x):
        if is_numeric(x):
            x=int(x)
    return x
952955
def _p100(part, total, prec=1):
    '''
    '''
    r = float(total)
    if r:
        r = part * 100.0 / r
        return '%.*f%%' % (prec, r)
    return 'n/a'
362996
def print_float(self, value, decimal_digits=2, justify_right=True):
        
        format_string = '{{0:0.{0}F}}'.format(decimal_digits)
        self.print_number_str(format_string.format(value), justify_right)
1072159
def _F(self, X):
        
        if isinstance(X, int) or isinstance(X, float):
            if X < 1 and X > 0:
                a = 1/(X**2-1)*(1-2/np.sqrt(1-X**2)*np.arctanh(np.sqrt((1-X)/(1+X))))
            elif X == 1:
                a = 1./3
            elif X > 1:
                a = 1/(X**2-1)*(1-2/np.sqrt(X**2-1)*np.arctan(np.sqrt((X-1)/(1+X))))
            else:  # X == 0:
                c = 0.0000001
                a = 1/(-1)*(1-2/np.sqrt(1)*np.arctanh(np.sqrt((1-c)/(1+c))))

        else:
            a = np.empty_like(X)
            x = X[(X < 1) & (X > 0)]
            a[(X < 1) & (X > 0)] = 1/(x**2-1)*(1-2/np.sqrt(1-x**2)*np.arctanh(np.sqrt((1-x)/(1+x))))

            a[X == 1] = 1./3.

            x = X[X > 1]
            a[X > 1] = 1/(x**2-1)*(1-2/np.sqrt(x**2-1)*np.arctan(np.sqrt((x-1)/(1+x))))
            # a[X>y] = 0

            c = 0.0000001
            a[X == 0] = 1/(-1)*(1-2/np.sqrt(1)*np.arctanh(np.sqrt((1-c)/(1+c))))
        return a