anchor
dict
positive
dict
negative
dict
{ "audio": "", "image": "", "text": "func (m *containerManager) ListContainers() ([]instances.Instance, error) {\n\tcontainers, err := m.server.FilterContainers(m.namespace.Prefix())\n\tif err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\n\tvar result []instances.Instance\n", "video": "" }
{ "audio": "", "image": "", "text": "\tfor _, i := range containers {\n\t\tresult = append(result, &lxdInstance{i.Name, m.server.ContainerServer})\n\t}\n\treturn result, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\n\tif err := m.txn.HDel(mDBs, dbKey); err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (m *containerManager) getContainerSpec(\n\tinstanceConfig *instancecfg.InstanceConfig,\n\tcons constraints.Value,\n\tseries string,\n\tnetworkConfig *container.NetworkConfig,\n\tstorageConfig *container.StorageConfig,\n\tcallback environs.StatusCallbackFunc,\n) (Container...
{ "audio": "", "image": "", "text": " by falling back to either a single \"eth0\",\n\t// or devices from the profile.\n\t// Ensure that the devices are represented in the cloud-init user-data.\n\tif len(networkConfig.Interfaces) == 0 {\n\t\tinterfaces, err := InterfaceInfoFromDevices(nics)\n\t\tif err != nil {\n\...
{ "audio": "", "image": "", "text": " {\n\t\t\treturn err\n\t\t}\n\n\t\t// Wait for leadership.\n\t\tif err := m.waitForLeader(60 * time.Second); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Wait for store to catchup\n\t\tfor m.store.LastIndex() < targetLogIndex.LastIndex {\n\t\t\tm.logger.Println(\"Waiting fo...
{ "audio": "", "image": "", "text": "func (m *containerManager) getImageSources() ([]ServerSpec, error) {\n\timURL := m.imageMetadataURL\n\n\t// Unless the configuration explicitly requests the daily stream,\n\t// an empty image metadata URL results in a search of the default sources.\n\tif imURL == \"\" && m.ima...
{ "audio": "", "image": "", "text": "\t}\n\timURL = EnsureHTTPS(imURL)\n\tremote := ServerSpec{\n\t\tName: strings.Replace(imURL, \"https://\", \"\", 1),\n\t\tHost: imURL,\n\t\tProtocol: SimpleStreamsProtocol,\n\t}\n\n\t// If the daily stream was configured with custom image metadata URL,\n\t// only use t...
{ "audio": "", "image": "", "text": " nil {\n\t\treturn false\n\t}\n\t// Has the job annotation\n\tif image.Config.Labels[labelGenerateJob] == \"true\" {\n\t\treturn true\n\t}\n\treturn false\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (m *containerManager) networkDevicesFromConfig(netConfig *container.NetworkConfig) (map[string]device, []string, error) {\n\tif len(netConfig.Interfaces) > 0 {\n\t\treturn DevicesFromInterfaceInfo(netConfig.Interfaces)\n\t} else if netConfig.Device != \"\" {\n\t\treturn m...
{ "audio": "", "image": "", "text": " network.GenerateVirtualMACAddress(), netConfig.MTU),\n\t\t}, nil, nil\n\t}\n\n\tnics, err := m.server.GetNICsFromProfile(lxdDefaultProfileName)\n\treturn nics, nil, errors.Trace(err)\n}", "video": "" }
{ "audio": "", "image": "", "text": " Only count each adapter once.\n\t\tif adapters.Has(iStat.Name) {\n\t\t\tcontinue\n\t\t}\n\n\t\tresult.Interfaces = append(result.Interfaces, *iStat)\n\t\tadapters.Insert(iStat.Name)\n\t}\n\n\t// TODO(feiskyer): add support of multiple interfaces for getting default interface....
{ "audio": "", "image": "", "text": "func (m *containerManager) LXDProfileNames(containerName string) ([]string, error) {", "video": "" }
{ "audio": "", "image": "", "text": "\n\treturn m.server.GetContainerProfiles(containerName)\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\treturn func(p *Prompt) error {\n\t\tp.keyBindMode = m\n\t\treturn nil\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (i *injector) Map(val interface{}) TypeMapper {\n", "video": "" }
{ "audio": "", "image": "", "text": "\ti.values[reflect.TypeOf(val)] = reflect.ValueOf(val)\n\treturn i\n}", "video": "" }
{ "audio": "", "image": "", "text": " interface{} {\n\tval := t.Get(key)\n\tif val == nil {\n\t\treturn def\n\t}\n\treturn val\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (i *injector) Set(typ reflect.Type, val reflect.Value) TypeMapper {\n", "video": "" }
{ "audio": "", "image": "", "text": "\ti.values[typ] = val\n\treturn i\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tval := DurationValue{}\n\t\tif t != reflect.TypeOf(val) {\n\t\t\treturn data, nil\n\t\t}\n\t\tif err := val.Set(data.(string)); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn val, nil\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *SLSHook) Levels() []logrus.Level {\n\tif p.AcceptedLevels == nil {\n", "video": "" }
{ "audio": "", "image": "", "text": "\t\treturn allLevels\n\t}\n\treturn p.AcceptedLevels\n}", "video": "" }
{ "audio": "", "image": "", "text": " logrus.AllLevels {\n\t\tif l <= level {\n\t\t\tlevels = append(levels, l)\n\t\t}\n\t}\n\n\treturn func(h *Hook) {\n\t\th.triggers = levels\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func newFileWriter() *fileLogWriter {\n\tw := &fileLogWriter{\n\t\tDaily: true,\n\t\tMaxDays: 7,\n\t\tRotate: true,\n\t\tRotatePerm: \"0440\",", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\tLevel: LevelDebug,\n\t\tPerm: \"0660\",\n\t}\n\treturn w\n}", "video": "" }
{ "audio": "", "image": "", "text": " func(x float32) float32 {\n\t\t\treturn powf32(x, e)\n\t\t},\n\t\tlut: true,\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (w *fileLogWriter) WriteMsg(when time.Time, msg string, level int) error {\n\tif level > w.Level {\n\t\treturn nil\n\t}\n\th, d := formatTimeHeader(when)\n\tmsg = string(h) + msg + \"\\n\"\n\tif w.Rotate {\n\t\tw.RLock()\n\t\tif w.needRotate(len(msg), d) {\n\t\t\tw.RUnloc...
{ "audio": "", "image": "", "text": "\t\t}\n\t\t\t}\n\t\t\tw.Unlock()\n\t\t} else {\n\t\t\tw.RUnlock()\n\t\t}\n\t}\n\n\tw.Lock()\n\t_, err := w.fileWriter.Write([]byte(msg))\n\tif err == nil {\n\t\tw.maxLinesCurLines++\n\t\tw.maxSizeCurSize += len(msg)\n\t}\n\tw.Unlock()\n\treturn err\n}", "video": "" }
{ "audio": "", "image": "", "text": " []byte) {\n\tw.dict = dict\n\tw.d.reset(dst)\n\tw.d.fillWindow(w.dict)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func Log10(z, x *decimal.Big) *decimal.Big {\n\tif logSpecials(z, x) {\n\t\treturn z\n\t}\n\n\t// If x is a power of 10 the result is the exponent and exact.\n\tvar tpow bool\n\tif m, u := decimal.Raw(x); *m != c.Inflated {\n\t\ttpow = arith.PowOfTen(*m)\n\t} else {\n\t\ttpow"...
{ "audio": "", "image": "", "text": " = arith.PowOfTenBig(u)\n\t}\n\tif tpow {\n\t\tctx := decimal.Context{Precision: precision(z)}\n\t\treturn ctx.Set(z, z.SetMantScale(int64(adjusted(x)), 0))\n\t}\n\treturn log(z, x, true)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t} else {\n\t\tf.x = f.w + x\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func Log(z, x *decimal.Big) *decimal.Big {\n\tif logSpecials(z, x) {\n\t\treturn z\n\t}\n\tif x.IsInt() {\n\t\tif v, ok := x.Uint64(); ok {\n\t\t\tswitch v {\n\t\t\tcase 1:\n\t\t\t\t// ln 1 = 0\n\t\t\t\treturn z.SetMantScale(0, 0)\n\t\t\tcase 10:\n\t\t", "video": "" }
{ "audio": "", "image": "", "text": "\t\t// Specialized function.\n\t\t\t\treturn ln10(z, precision(z))\n\t\t\t}\n\t\t}\n\t}\n\treturn log(z, x, false)\n}", "video": "" }
{ "audio": "", "image": "", "text": " len(x.Children))\n\n\tfor i := range x.Children {\n\t\tret[i] = x.Children[i]\n\t}\n\n\treturn ret\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (d *Decimal) Value() (driver.Value, error) {\n\tif d.V == nil {\n\t\tif d.Zero {\n\t\t\treturn \"0\", nil\n\t\t}\n\t\treturn nil, nil\n\t}\n\tv := d.V\n\tif v.IsNaN(0) {\n\t\treturn \"NaN\", nil\n\t}\n\tif v.IsInf(0) {\n\t\treturn nil, errors.New(\"Decimal.Value: DECIMAL ...
{ "audio": "", "image": "", "text": "\t// Rounding down the integral part automatically chops off the fractional\n\t\t// part.\n\t\treturn v.Round(MaxIntegralDigits).String(), nil\n\t}\n\tif sl > MaxFractionalDigits {\n\t\tif !d.Round {\n\t\t\treturn nil, &LengthError{Part: \"fractional\", N: sl, max: MaxFraction...
{ "audio": "", "image": "", "text": " payload {\n\t\tif v < 48 || v >= 120 {\n\t\t\tp.SetErr(context, \"data byte\")\n\t\t\treturn nil\n\t\t}\n\n\t\td := v - 48\n\t\tif d > 40 {\n\t\t\td -= 8\n\t\t}\n\n\t\tfor i := 5; i >= 0 && resultIndex < len(result); i-- {\n\t\t\tresult[resultIndex] = (d >> uint(i)) & 1\n\t\t...
{ "audio": "", "image": "", "text": "func Length(x uint64) int {\n\tif x < 10 {\n\t\treturn 1\n\t}\n\t// From https://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10", "video": "" }
{ "audio": "", "image": "", "text": "\n\tr := int((bits.Len64(x) * 1233) >> 12)\n\tif p, _ := Pow10(uint64(r)); x < p {\n\t\treturn r\n\t}\n\treturn r + 1\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\tcase x < 1<<42:\n\t\treturn 6\n\tcase x < 1<<49:\n\t\treturn 7\n\tcase x < 1<<56:\n\t\treturn 8\n\tcase x < 1<<63:\n\t\treturn 9\n\t}\n\treturn 10\n}", "video": "" }
{ "audio": "", "image": "", "text": "func BigLength(x *big.Int) int {\n\tif x.Sign() == 0 {\n\t\treturn 1\n\t}\n\n\tvar (\n\t\tm uint64\n\t\tnb = uint64(x.BitLen())\n\t)\n\n\t// overflowCutoff is the largest number where N * 0x268826A1 <= 1<<63 - 1\n\tconst overflowCutoff = 14267572532\n\tif nb > overflowCutoff ...
{ "audio": "", "image": "", "text": " 1\n\t\tnb = (nb / overflowCutoff) + (nb % overflowCutoff)\n\t}\n\n\t// 0x268826A1/2^31 is an approximation of log10(2). See ilog10.\n\t// The more accurate approximation 0x268826A13EF3FE08/2^63 overflows.\n\tm += ((nb + 1) * 0x268826A1) >> 31\n\n\tif x.CmpAbs(BigPow10(m)) < 0...
{ "audio": "", "image": "", "text": " i, x := range xs {\n\t\tm += (x - m) / float64(i+1)\n\t}\n\treturn m\n}", "video": "" }
{ "audio": "", "image": "", "text": "func Abs(x int64) uint64 {\n\tm := x >> 63", "video": "" }
{ "audio": "", "image": "", "text": "\n\treturn uint64((x ^ m) - m)\n}", "video": "" }
{ "audio": "", "image": "", "text": " (X >> 8)) & 0x0000ffff0000ffff\n\tX = (X | (X >> 16)) & 0x00000000ffffffff\n\treturn uint32(X)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func CmpBits(x, y []big.Word) (r int) {\n\t// Copied from math/big.nat.go\n\tm := len(x)\n\tn := len(y)\n\tif m != n || m == 0 {\n\t\tswitch {\n\t\tcase m < n:\n\t\t\tr = -1\n\t\tcase m > n:\n\t\t\tr = 1\n\t\t}\n\t\treturn\n\t}\n\n\ti", "video": "" }
{ "audio": "", "image": "", "text": " := m - 1\n\tfor i > 0 && x[i] == y[i] {\n\t\ti--\n\t}\n\n\tswitch {\n\tcase x[i] < y[i]:\n\t\tr = -1\n\tcase x[i] > y[i]:\n\t\tr = 1\n\t}\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\tif r.Code >= 200 && r.Code < 400 {\n\t\tm.success++\n\t}\n\n\tif r.Error != \"\" {\n\t\tif _, ok := m.errors[r.Error]; !ok {\n\t\t\tm.errors[r.Error] = struct{}{}\n\t\t\tm.Errors = append(m.Errors, r.Error)\n\t\t}\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func Words(x uint64) []big.Word {\n\tif bits.UintSize == 32 {\n\t\treturn []big.Word{big.Word(x),", "video": "" }
{ "audio": "", "image": "", "text": " big.Word(x >> 32)}\n\t}\n\treturn []big.Word{big.Word(x)}\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\tif word, ok := m.(*Word); ok {\n\t\t\tif word.Address == address {\n\t\t\t\tres = append(res, word.Command)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}", "video": "" }
{ "audio": "", "image": "", "text": "func Add(z, x *big.Int, y uint64) *big.Int {\n\tzw := z.Bits()\n\tswitch xw := x.Bits(); {\n\tdefault:\n", "video": "" }
{ "audio": "", "image": "", "text": "\t\tzw = add(zw, xw, big.Word(y))\n\tcase len(xw) == 0:\n\t\tzw = setW(zw, big.Word(y))\n\tcase y == 0:\n\t\tzw = set(zw, xw)\n\t}\n\treturn z.SetBits(zw)\n}", "video": "" }
{ "audio": "", "image": "", "text": " out.Y <= min {\n\t\ty = min\n\t} else {\n\t\ty = max\n\t}\n\tx := in.X + dx*(y-in.Y)/dy\n\tp.X, p.Y = x, y\n\tp.DeltaX, p.DeltaY = math.NaN(), math.NaN()\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "func Sub(z, x *big.Int, y uint64) *big.Int {\n\tzw := z.Bits()\n\tswitch xw := x.Bits(); {\n\tdefault:\n", "video": "" }
{ "audio": "", "image": "", "text": "\t\tzw = sub(zw, xw, big.Word(y))\n\tcase y == 0:\n\t\tzw = set(zw, xw)\n\tcase len(xw) == 0:\n\t\tpanic(\"underflow\")\n\t}\n\treturn z.SetBits(zw)\n}", "video": "" }
{ "audio": "", "image": "", "text": " NewArithmeticConstraint(FUNC_OP, []Attribute{a1, a2},\n\t\t\tfunc(x []int) int {\n\t\t\t\treturn fn(x[0], x[1])\n\t\t\t})\n\t} else {\n\t\treturn NewArithmeticConstraint(SUB_OP, []Attribute{a1, a2}, nil)\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func Set(z *big.Int, z1, z0 uint64) *big.Int {\n\tww := makeWord(z.Bits(), 128/bits.UintSize)\n\tif bits.UintSize == 32 {\n\t\tww[3] = big.Word(z1 >> 32)\n\t\tww[2] = big.Word(z1)\n\t\tww[1] = big.Word(z0 >> 32)\n\t", "video": "" }
{ "audio": "", "image": "", "text": "\tww[0] = big.Word(z0)\n\t} else {\n\t\tww[1] = big.Word(z1)\n\t\tww[0] = big.Word(z0)\n\t}\n\treturn z.SetBits(ww)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\tv |= v >> 16\n\tv |= v >> 32\n\tv++\n\treturn v\n}", "video": "" }
{ "audio": "", "image": "", "text": "func add(z, x []big.Word, y big.Word) []big.Word {\n\tm := len(x)\n\tconst n = 1\n\n\t// m > 0 && y > 0\n\n\tz = makeWord(z, m+1)\n\tvar c big.Word\n\t// addVV(z[0:m], x, y) but WW since len(y) == 1\n\tc,", "video": "" }
{ "audio": "", "image": "", "text": " z[0] = addWW(x[0], y, 0)\n\tif m > n {\n\t\tc = addVW(z[n:m], x[n:], c)\n\t}\n\tz[m] = c\n\treturn norm(z)\n}", "video": "" }
{ "audio": "", "image": "", "text": " out.Y <= min {\n\t\ty = min\n\t} else {\n\t\ty = max\n\t}\n\tx := in.X + dx*(y-in.Y)/dy\n\tp.X, p.Y = x, y\n\tp.DeltaX, p.DeltaY = math.NaN(), math.NaN()\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "func sub(z, x []big.Word, y big.Word) []big.Word {\n\tm := len(x)\n\tconst n = 1\n\n\t// m > 0 && y > 0\n\n\tz = makeWord(z, m)\n\t// subVV(z[0:m], x, y) but WW since len(y) == 1\n\tvar c big.Word\n\tc, z[0] = subWW(x[0], y,", "video": "" }
{ "audio": "", "image": "", "text": " 0)\n\tif m > n {\n\t\tc = subVW(z[n:], x[n:], c)\n\t}\n\tif c != 0 {\n\t\tpanic(\"underflow\")\n\t}\n\treturn norm(z)\n}", "video": "" }
{ "audio": "", "image": "", "text": " out.Y <= min {\n\t\ty = min\n\t} else {\n\t\ty = max\n\t}\n\tx := in.X + dx*(y-in.Y)/dy\n\tp.X, p.Y = x, y\n\tp.DeltaX, p.DeltaY = math.NaN(), math.NaN()\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "func addVW(z, x []big.Word, y big.Word) (c big.Word) {\n\tc = y\n\tfor i, xi", "video": "" }
{ "audio": "", "image": "", "text": " := range x[:len(z)] {\n\t\tzi := xi + c\n\t\tz[i] = zi\n\t\tc = xi &^ zi >> (bits.UintSize - 1)\n\t}\n\treturn c\n}", "video": "" }
{ "audio": "", "image": "", "text": " out.Y <= min {\n\t\ty = min\n\t} else {\n\t\ty = max\n\t}\n\tx := in.X + dx*(y-in.Y)/dy\n\tp.X, p.Y = x, y\n\tp.DeltaX, p.DeltaY = math.NaN(), math.NaN()\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "func E(z *decimal.Big) *decimal.Big {\n\tctx := decimal.Context{Precision: precision(z)}\n\tif ctx.Precision <= constPrec {\n\t\treturn ctx.Set(z, _E)\n\t}\n\n\tctx.Precision += 5\n\tvar (\n\t\tsum = z.SetUint64(2)\n\t\tfac = new(decimal.Big).SetUint64(1)\n\t\tterm = new(dec...
{ "audio": "", "image": "", "text": " one), but either\n\t\t// the costly call to Quo makes it difficult to notice.\n\t\tterm.SetUint64(i)\n\t\tctx.Mul(fac, fac, term)\n\t\tctx.Quo(term, one, fac)\n\t\tprev.Copy(sum)\n\t\tctx.Add(sum, sum, term)\n\t}\n\n\tctx.Precision -= 5\n\treturn ctx.Set(z, sum)\n}", "video...
{ "audio": "", "image": "", "text": "\t}\n\trawHeader, err := ec.client.HeaderByNumber(ctx.context, big.NewInt(number))\n\treturn &Header{rawHeader}, err\n}", "video": "" }
{ "audio": "", "image": "", "text": "func Pi(z *decimal.Big) *decimal.Big {", "video": "" }
{ "audio": "", "image": "", "text": "\n\treturn pi(z, decimal.Context{Precision: precision(z)})\n}", "video": "" }
{ "audio": "", "image": "", "text": " big.Int(*ipv6.Mask)\n\tcopy(ipv6Mask, m.Bytes())\n\treturn &ipv6Mask\n}", "video": "" }
{ "audio": "", "image": "", "text": "func pi(z *decimal.Big, ctx decimal.Context) *decimal.Big {\n\tif ctx.Precision <= constPrec {\n\t\treturn ctx.Set(z, _Pi)\n\t}\n\n\tvar (\n\t\tlasts = new(decimal.Big)\n\t\tt = new(decimal.Big).SetUint64(3)\n\t\ts = z.SetUint64(3)\n\t\tn = new(decimal.Big).SetUint...
{ "audio": "", "image": "", "text": "\tlasts.Copy(s)\n\t\tctx.Add(n, n, na)\n\t\tctx.Add(na, na, eight)\n\t\tctx.Add(d, d, da)\n\t\tctx.Add(da, da, thirtyTwo)\n\t\tctx.Mul(t, t, n)\n\t\tctx.Quo(t, t, d)\n\t\tctx.Add(s, s, t)\n\t}\n\treturn ctx.Round(z) // z == s\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t}\n\tcase 14:\n\t\tp, _ := new(big.Int).SetString(\"FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE...
{ "audio": "", "image": "", "text": "func PowOfTenBig(x *big.Int) bool {\n\tif x.Bit(0) != 0 {\n\t\treturn x.Cmp(c.OneInt) == 0\n\t}\n\tif x.Sign() == 0 {\n\t\treturn true\n\t}\n\tq := new(big.Int).Set(x)\n\tr := new(big.Int)\n\tfor len := BigLength(x); len > 20; len-- {\n", "video": "" }
{ "audio": "", "image": "", "text": "\t\tq.QuoRem(q, c.TenInt, r)\n\t\tif r.Sign() != 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn PowOfTen(q.Uint64())\n}", "video": "" }
{ "audio": "", "image": "", "text": " len(x.Children))\n\n\tfor i := range x.Children {\n\t\tret[i] = x.Children[i]\n\t}\n\n\treturn ret\n}", "video": "" }
{ "audio": "", "image": "", "text": "func Floor(z, x *decimal.Big) *decimal.Big {\n\tif z.CheckNaNs(x, nil) {\n\t\treturn z\n\t}\n\tctx := z.Context\n", "video": "" }
{ "audio": "", "image": "", "text": "\tctx.RoundingMode = decimal.ToNegativeInf\n\treturn ctx.RoundToInt(z.Copy(x))\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tif z.skipWhiteSpace(); z.err != nil {\n\t\tz.data.start = z.raw.end\n\t\tz.data.end = z.raw.end\n\t\treturn true\n\t}\n\tz.readUntilCloseAngle()\n\treturn true\n}", "video": "" }
{ "audio": "", "image": "", "text": "func Ceil(z, x *decimal.Big) *decimal.Big {\n\t// ceil(x) = -floor(-x)\n", "video": "" }
{ "audio": "", "image": "", "text": "\treturn z.Neg(Floor(z, misc.CopyNeg(z, x)))\n}", "video": "" }
{ "audio": "", "image": "", "text": " len(x.Children))\n\n\tfor i := range x.Children {\n\t\tret[i] = x.Children[i]\n\t}\n\n\treturn ret\n}", "video": "" }
{ "audio": "", "image": "", "text": "func allZeros(b []byte) bool {\n\tfor _, c := range b {\n\t\tif c != '0'", "video": "" }
{ "audio": "", "image": "", "text": " {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tif i+n > cap(b) {\n\t\tb = append(b, make([]byte, n)...)\n\t} else {\n\t\tb = b[:i+n]\n\t}\n\n\t// print fractional-part\n\ti += n - 1\n\tif dec {\n\t\tfor j := 0; j < 2; j++ {\n\t\t\tc := byte(price%10) + '0'\n\t\t\tprice /= 10\n\t\t\tb[i] = c\n\t\t\ti--\n\t\t}\n\t\tb[i] = ...
{ "audio": "", "image": "", "text": "func formatCompact(x uint64) []byte {\n\tvar b [20]byte\n\treturn", "video": "" }
{ "audio": "", "image": "", "text": " strconv.AppendUint(b[0:0], uint64(x), 10)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t}\n\tvar x int64\n\tfor i := range b {\n\t\tx = (x << 8) + int64(b[i]&0xFF)\n\t}\n\treturn x, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (f *formatter) formatSci(b []byte, adj int, e byte) {\n\tf.WriteByte(b[0])\n\n\tif len(b) > 1 {\n\t\tf.WriteByte('.')\n\t\tf.Write(b[1:])\n", "video": "" }
{ "audio": "", "image": "", "text": "\t}\n\n\t// If negative, the call to strconv.Itoa will add the minus sign for us.\n\tf.WriteByte(e)\n\tif adj > 0 {\n\t\tf.WriteByte('+')\n\t}\n\tf.WriteString(strconv.Itoa(adj))\n}", "video": "" }
{ "audio": "", "image": "", "text": " append functions to the right of the bar\n\tfor _, f := range b.appendFuncs {\n\t\tpb = append(pb, ' ')\n\t\tpb = append(pb, []byte(f(b))...)\n\t}\n\n\t// render prepend functions to the left of the bar\n\tfor _, f := range b.prependFuncs {\n\t\targs := []byte(f(b))\n\t\targs...
{ "audio": "", "image": "", "text": "func (f *formatter) formatPlain(b []byte, exp int) {\n\tconst zeroRadix = \"0.\"\n\n\tswitch radix := len(b) + exp; {\n\t// log10(b) == scale, so immediately before b: 0.123456\n\tcase radix == 0:\n\t\tf.WriteString(zeroRadix)\n\t\tf.Write(b)\n\n\t// log10(b) > scale, so somew...
{ "audio": "", "image": "", "text": " scale, so before p \"0s\" and before b: 0.00000123456\n\tdefault:\n\t\tf.WriteString(zeroRadix)\n\t\tio.CopyN(f, zeroReader{}, -int64(radix))\n\n\t\tend := len(b)\n\t\tif f.prec < end {\n\t\t\tend = f.prec\n\t\t}\n\t\tf.Write(b[:end])\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " := b.dsrFilter\n\tb.dsrFilter = f\n\treturn old\n}", "video": "" }
{ "audio": "", "image": "", "text": "func alias(z, x *big.Int) *big.Int {\n\tif z != x {\n\t\t// We have to check the first element of their internal slices since\n\t\t// Big doesn't store a pointer to a big.Int.\n\t\tzb, xb := z.Bits(), x.Bits()\n\t\tif cap(zb) >", "video": "" }
{ "audio": "", "image": "", "text": " 0 && cap(xb) > 0 && &zb[0:cap(zb)][cap(zb)-1] != &xb[0:cap(xb)][cap(xb)-1] {\n\t\t\treturn z\n\t\t}\n\t}\n\treturn new(big.Int)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\truneCount++\n\t\t\tif runeCount == prefixLen {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t// Find the index associated with the phrase.\n\t\tvar tmp *big.Int\n\t\tfound := false\n\t\tfor j, word := range dict {\n\t\t\tif strings.HasPrefix(word, string(prefix)) {\n\t\t\t\ttmp = ...
{ "audio": "", "image": "", "text": "func bigScalex(z, x *big.Int, scale int) *big.Int {\n\tif scale > 0 {", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\treturn arith.MulBigPow10(z, x, uint64(scale))\n\t}\n\treturn z.Quo(x, arith.BigPow10(uint64(-scale)))\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tif days > 0 {\n\t\treturn fmt.Sprintf(\"%dd\", days)\n\t}\n\tif hours > 0 {\n\t\treturn fmt.Sprintf(\"%dh\", hours)\n\t}\n\tif int(minutes) > 0 {\n\t\treturn fmt.Sprintf(\"%dm\", int(minutes))\n\t}\n\n\treturn \"< 1m\"\n}", "video": "" }
{ "audio": "", "image": "", "text": "func Sqrt(z, x *decimal.Big) *decimal.Big {\n\tif z.CheckNaNs(x, nil) {\n\t\treturn z\n\t}\n\n\tideal := -((-x.Scale() - (-x.Scale() & 1)) / 2)\n\tif xs := x.Sign(); xs <= 0 {\n\t\tif xs == 0 {\n\t\t\treturn z.SetMantScale(0, ideal).CopySign(z, x)\n\t\t}\n\t\tz.Context.Conditi...
{ "audio": "", "image": "", "text": "\t}\n\n\tmaxp := prec + 5 // extra prec to skip weird +/- 0.5 adjustments\n\tctx.Precision = 3\n\tfor {\n\t\t// p := min(2*p - 2, maxp)\n\t\tctx.Precision = min(2*ctx.Precision-2, maxp)\n\n\t\t// approx := .5*(approx + f/approx)\n\t\tctx.Mul(z, ptFive, ctx.Add(&tmp, z, ctx.Quo...
{ "audio": "", "image": "", "text": "\tz.digest = crc32.Update(z.digest, crc32.IEEETable, data)\n\t\thdr.Extra = data\n\t}\n\n\tvar s string\n\tif flg&flagName != 0 {\n\t\tif s, err = z.readString(); err != nil {\n\t\t\treturn hdr, err\n\t\t}\n\t\thdr.Name = s\n\t}\n\n\tif flg&flagComment != 0 {\n\t\tif s, err = ...
{ "audio": "", "image": "", "text": "func (c Context) Err() error {\n\tif m := c.Conditions & c.Traps; m !=", "video": "" }
{ "audio": "", "image": "", "text": " 0 {\n\t\treturn m\n\t}\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " errors.Annotate(err, \"failed to unmarshal JobConfig\").Err()\n\t}\n\treturn func(c context.Context, keys []*datastore.Key) error {\n\t\treturn m.Func(c, j.ID, cfg, keys)\n\t}, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func WithContext(c Context) *Big {\n\tz :=", "video": "" }
{ "audio": "", "image": "", "text": " new(Big)\n\tz.Context = c\n\treturn z\n}", "video": "" }
{ "audio": "", "image": "", "text": " *r.WithContext(context.WithValue(r.Context(), StatusCtxKey, status))\n}", "video": "" }
{ "audio": "", "image": "", "text": "func WithPrecision(p int) *Big {\n\tz := new(Big)\n\tswitch {\n\tcase p > 0 && p <= UnlimitedPrecision:\n\t\tz.Context.Precision = p\n\tcase p == 0:\n", "video": "" }
{ "audio": "", "image": "", "text": "\t\tz.Context.Precision = DefaultPrecision\n\tdefault:\n\t\tz.setNaN(InvalidContext, qnan, invctxpgtu)\n\t}\n\treturn z\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\t\ts = \"https\"\n\t\t}\n\t\tif d == domain && rs == s {\n\t\t\th.ServeHTTP(w, r)\n\t\t\treturn\n\t\t}\n\t\tswitch {\n\t\tcase s == \"http\" && p == \"80\":\n\t\t\tp = \"\"\n\t\tcase s == \"https\" && p == \"443\":\n\t\t\tp = \"\"\n\t\tcase port != \"\":\n\t\t\tp = \":\" + ...
{ "audio": "", "image": "", "text": "func (c Context) Add(z, x, y *Big) *Big {\n\tif debug {\n\t\tx.validate()\n\t\ty.validate()\n\t}\n\tif z.invalidContext(c) {\n\t\treturn z\n\t}\n\n\tif x.IsFinite() && y.IsFinite() {\n\t\tz.form = c.add(z, x, x.form, y, y.form)\n\t\treturn c.round(z)\n\t}\n\n\t// NaN + NaN\n\t...
{ "audio": "", "image": "", "text": " 0 && x.form^y.form == signbit {\n\t\t\t// +Inf + -Inf\n\t\t\t// -Inf + +Inf\n\t\t\treturn z.setNaN(InvalidOperation, qnan, addinfinf)\n\t\t}\n\t\t// ±Inf + y\n\t\t// +Inf + +Inf\n\t\t// -Inf + -Inf\n\t\treturn z.Set(x)\n\t}\n\t// x + ±Inf\n\treturn z.Set(y)\n}", "video": ""...
{ "audio": "", "image": "", "text": " out.Y <= min {\n\t\ty = min\n\t} else {\n\t\ty = max\n\t}\n\tx := in.X + dx*(y-in.Y)/dy\n\tp.X, p.Y = x, y\n\tp.DeltaX, p.DeltaY = math.NaN(), math.NaN()\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c Context) mul(z, x, y *Big) *Big {\n\tif debug {\n\t\tx.validate()\n\t\ty.validate()\n\t}\n\n\tsign := x.form&signbit ^ y.form&signbit\n\n\tif x.IsFinite() && y.IsFinite() {\n\t\tz.form = finite | sign\n\t\tz.exp = x.exp + y.exp\n\n\t\t// Multiplication is simple, so in...
{ "audio": "", "image": "", "text": "\t}\n\t\treturn z.norm()\n\t}\n\n\t// NaN * NaN\n\t// NaN * y\n\t// x * NaN\n\tif z.checkNaNs(x, y, multiplication) {\n\t\treturn z\n\t}\n\n\tif (x.IsInf(0) && !y.isZero()) ||\n\t\t(y.IsInf(0) && !x.isZero()) ||\n\t\t(y.IsInf(0) && x.IsInf(0)) {\n\t\t// ±Inf * y\n\t\t// x * ±I...
{ "audio": "", "image": "", "text": " out.Y <= min {\n\t\ty = min\n\t} else {\n\t\ty = max\n\t}\n\tx := in.X + dx*(y-in.Y)/dy\n\tp.X, p.Y = x, y\n\tp.DeltaX, p.DeltaY = math.NaN(), math.NaN()\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c Context) Quantize(z *Big, n int) *Big {\n\tif debug {\n\t\tz.validate()\n\t}\n\tif z.invalidContext(c) {\n\t\treturn z\n\t}\n\n\tn = -n\n\tif z.isSpecial() {\n\t\tif z.form&inf != 0 {\n\t\t\treturn z.setNaN(InvalidOperation, qnan, quantinf)\n\t\t}\n\t\tz.checkNaNs(z, z...
{ "audio": "", "image": "", "text": " z.setTriple(zc, neg, n)\n\t\t\t}\n\t\t\t// shift < 0\n\t\t} else if yc, ok := arith.Pow10(uint64(-shift)); ok {\n\t\t\tz.quo(m, z.compact, neg, yc, 0)\n\t\t\treturn z\n\t\t}\n\t\tz.unscaled.SetUint64(z.compact)\n\t\tz.compact = cst.Inflated\n\t}\n\n\tif shift > 0 {\n\t\tarith...
{ "audio": "", "image": "", "text": "\tif z.skipWhiteSpace(); z.err != nil {\n\t\tz.data.start = z.raw.end\n\t\tz.data.end = z.raw.end\n\t\treturn true\n\t}\n\tz.readUntilCloseAngle()\n\treturn true\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c Context) Reduce(z *Big) *Big {\n\tif debug", "video": "" }
{ "audio": "", "image": "", "text": " {\n\t\tz.validate()\n\t}\n\tc.Round(z)\n\treturn c.simpleReduce(z)\n}", "video": "" }
{ "audio": "", "image": "", "text": " crypto.Addressable, power *big.Int) error {\n\t\treturn AddPower(vs, id.GetPublicKey(), power)\n\t})\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c Context) simpleReduce(z *Big) *Big {\n\tif z.isSpecial() {\n\t\t// Same semantics as plus(z), i.e. z + 0.\n\t\tz.checkNaNs(z, z, reduction)\n\t\treturn z\n\t}\n\n\tif z.isZero() {\n\t\tz.exp = 0\n\t\tz.precision = 1\n\t\treturn z\n\t}\n\n\tif z.compact == cst.Inflated ...
{ "audio": "", "image": "", "text": " 20 {\n\t\t\tz.unscaled.QuoRem(&z.unscaled, cst.TenInt, &r)\n\t\t\tif r.Sign() != 0 {\n\t\t\t\tz.unscaled.Mul(&z.unscaled, cst.TenInt)\n\t\t\t\tz.unscaled.Add(&z.unscaled, &r)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tz.exp++\n\t\t\tz.precision--\n\t\t\tif z.unscaled.Bit(0) != 0 {\n\t\t\...
{ "audio": "", "image": "", "text": "\tif z.skipWhiteSpace(); z.err != nil {\n\t\tz.data.start = z.raw.end\n\t\tz.data.end = z.raw.end\n\t\treturn true\n\t}\n\tz.readUntilCloseAngle()\n\treturn true\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c Context) Rem(z, x, y *Big) *Big {\n\tif debug {\n\t\tx.validate()\n\t\ty.validate()\n\t}\n\tif z.invalidContext(c) {\n\t\treturn z\n\t}\n\n\tif x.IsFinite() && y.IsFinite() {\n\t\tif y.isZero() {\n\t\t\tif x.isZero() {\n\t\t\t\t// 0 / 0\n\t\t\t\treturn z.setNaN(Invalid...
{ "audio": "", "image": "", "text": "\t}\n\t\t// TODO(eric): See if we can get rid of tmp. See issue #72.\n\t\tvar tmp Big\n\t\t_, z = c.quorem(&tmp, z, x, y)\n\t\tz.exp = min(x.exp, y.exp)\n\t\ttmp.exp = 0\n\t\tif tmp.Precision() > precision(c) {\n\t\t\treturn z.setNaN(DivisionImpossible, qnan, quointprec)\n\t\t...
{ "audio": "", "image": "", "text": " out.Y <= min {\n\t\ty = min\n\t} else {\n\t\ty = max\n\t}\n\tx := in.X + dx*(y-in.Y)/dy\n\tp.X, p.Y = x, y\n\tp.DeltaX, p.DeltaY = math.NaN(), math.NaN()\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c Context) RoundToInt(z *Big) *Big {\n\tif z.isSpecial() || z.exp >= 0 {\n\t\treturn z", "video": "" }
{ "audio": "", "image": "", "text": "\n\t}\n\tc.Precision = z.Precision()\n\treturn c.Quantize(z, 0)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tif z.skipWhiteSpace(); z.err != nil {\n\t\tz.data.start = z.raw.end\n\t\tz.data.end = z.raw.end\n\t\treturn true\n\t}\n\tz.readUntilCloseAngle()\n\treturn true\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c Context) Set(z, x *Big) *Big {\n\treturn", "video": "" }
{ "audio": "", "image": "", "text": " c.Round(z.Copy(x))\n}", "video": "" }
{ "audio": "", "image": "", "text": " crypto.Addressable, power *big.Int) error {\n\t\treturn AddPower(vs, id.GetPublicKey(), power)\n\t})\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c Context) SetString(z *Big, s string) (*Big, bool) {\n\tif _, ok := z.SetString(s); !ok {", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\treturn nil, false\n\t}\n\treturn c.Round(z), true\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tz.digest = crc32.Update(z.digest, crc32.IEEETable, data)\n\t\thdr.Extra = data\n\t}\n\n\tvar s string\n\tif flg&flagName != 0 {\n\t\tif s, err = z.readString(); err != nil {\n\t\t\treturn hdr, err\n\t\t}\n\t\thdr.Name = s\n\t}\n\n\tif flg&flagComment != 0 {\n\t\tif s, err = ...
{ "audio": "", "image": "", "text": "func (c Context) Sub(z, x, y *Big) *Big {\n\tif debug {\n\t\tx.validate()\n\t\ty.validate()\n\t}\n\tif z.invalidContext(c) {\n\t\treturn z\n\t}\n\n\tif x.IsFinite() && y.IsFinite() {\n\t\tz.form = c.add(z, x, x.form, y, y.form^signbit)\n\t\treturn c.round(z)\n\t}\n\n\t// NaN -...
{ "audio": "", "image": "", "text": " 0 && (x.form&signbit == y.form&signbit) {\n\t\t\t// -Inf - -Inf\n\t\t\t// -Inf - -Inf\n\t\t\treturn z.setNaN(InvalidOperation, qnan, subinfinf)\n\t\t}\n\t\t// ±Inf - y\n\t\t// -Inf - +Inf\n\t\t// +Inf - -Inf\n\t\treturn z.Set(x)\n\t}\n\t// x - ±Inf\n\treturn z.Neg(y)\n}", "...
{ "audio": "", "image": "", "text": " out.Y <= min {\n\t\ty = min\n\t} else {\n\t\ty = max\n\t}\n\tx := in.X + dx*(y-in.Y)/dy\n\tp.X, p.Y = x, y\n\tp.DeltaX, p.DeltaY = math.NaN(), math.NaN()\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "func CmpTotalAbs(x, y *decimal.Big) int {\n\txs := ord(x, true)\n\tys := ord(y, true)\n\tif xs != ys {\n\t\tif xs > ys {\n\t\t\treturn +1", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\t}\n\t\treturn -1\n\t}\n\tif xs != 0 {\n\t\treturn 0\n\t}\n\treturn x.CmpAbs(y)\n}", "video": "" }
{ "audio": "", "image": "", "text": " range xs {\n\t\trs[i].Begin, rs[i].End = xs[i], xs[i]\n\t}\n\treturn rs.Squash()\n}", "video": "" }
{ "audio": "", "image": "", "text": "func CopyAbs(z, x *decimal.Big)", "video": "" }
{ "audio": "", "image": "", "text": " *decimal.Big {\n\treturn z.CopySign(x, pos)\n}", "video": "" }
{ "audio": "", "image": "", "text": " false\n\t}\n\tz, ok := v.(*rsa.PrivateKey)\n\treturn z, ok\n}", "video": "" }
{ "audio": "", "image": "", "text": "func CopyNeg(z, x *decimal.Big) *decimal.Big {\n\tif x.Signbit() {\n\t", "video": "" }
{ "audio": "", "image": "", "text": "\treturn z.CopySign(x, pos)\n\t}\n\treturn z.CopySign(x, neg)\n}", "video": "" }
{ "audio": "", "image": "", "text": " len(x.Children))\n\n\tfor i := range x.Children {\n\t\tret[i] = x.Children[i]\n\t}\n\n\treturn ret\n}", "video": "" }
{ "audio": "", "image": "", "text": "func Max(x ...*decimal.Big) *decimal.Big {\n\tm := x[0]\n\tfor _, v := range x[1:] {\n", "video": "" }
{ "audio": "", "image": "", "text": "\t\tif v.Cmp(m) > 0 {\n\t\t\tm = v\n\t\t}\n\t}\n\treturn m\n}", "video": "" }
{ "audio": "", "image": "", "text": " i, x := range xs {\n\t\tm += (x - m) / float64(i+1)\n\t}\n\treturn m\n}", "video": "" }
{ "audio": "", "image": "", "text": "func MaxAbs(x ...*decimal.Big) *decimal.Big {\n\tm := x[0]\n\tfor _, v := range x[1:] {\n", "video": "" }
{ "audio": "", "image": "", "text": "\t\tif v.CmpAbs(m) > 0 {\n\t\t\tm = v\n\t\t}\n\t}\n\treturn m\n}", "video": "" }
{ "audio": "", "image": "", "text": " i, x := range xs {\n\t\tm += (x - m) / float64(i+1)\n\t}\n\treturn m\n}", "video": "" }
{ "audio": "", "image": "", "text": "func Min(x ...*decimal.Big) *decimal.Big {\n\tm := x[0]\n\tfor _, v := range x[1:] {\n", "video": "" }
{ "audio": "", "image": "", "text": "\t\tif v.Cmp(m) < 0 {\n\t\t\tm = v\n\t\t}\n\t}\n\treturn m\n}", "video": "" }
{ "audio": "", "image": "", "text": " i, x := range xs {\n\t\tm += (x - m) / float64(i+1)\n\t}\n\treturn m\n}", "video": "" }
{ "audio": "", "image": "", "text": "func MinAbs(x ...*decimal.Big) *decimal.Big {\n\tm := x[0]\n\tfor _, v := range x[1:] {\n", "video": "" }
{ "audio": "", "image": "", "text": "\t\tif v.CmpAbs(m) < 0 {\n\t\t\tm = v\n\t\t}\n\t}\n\treturn m\n}", "video": "" }
{ "audio": "", "image": "", "text": " i, x := range xs {\n\t\tm += (x - m) / float64(i+1)\n\t}\n\treturn m\n}", "video": "" }
{ "audio": "", "image": "", "text": "func maxfor(z *big.Int, n, sign int) {\n\tarith.Sub(z,", "video": "" }
{ "audio": "", "image": "", "text": " arith.BigPow10(uint64(n)), 1)\n\tif sign < 0 {\n\t\tz.Neg(z)\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\tif err := z.Reset(r); err != nil {\n\t\treturn nil, err\n\t}\n\treturn z, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func NextMinus(z, x *decimal.Big) *decimal.Big {\n\tif z.CheckNaNs(x, nil) {\n\t\treturn z\n\t}\n\n\tif x.IsInf(0) {\n\t\tif x.IsInf(-1) {\n\t\t\treturn z.SetInf(true)\n\t\t}\n\t\t_, m := decimal.Raw(z)\n\t\tmaxfor(m, precision(z), +1)\n\t\treturn z.SetBigMantScale(m, -etop(z)...
{ "audio": "", "image": "", "text": "\tctx.RoundingMode = decimal.ToNegativeInf\n\tctx.Set(z, x)\n\tctx.Sub(z, x, new(decimal.Big).SetMantScale(1, -etiny(z)+1))\n\tz.Context.Conditions &= ctx.Conditions\n\treturn z\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tif z.skipWhiteSpace(); z.err != nil {\n\t\tz.data.start = z.raw.end\n\t\tz.data.end = z.raw.end\n\t\treturn true\n\t}\n\tz.readUntilCloseAngle()\n\treturn true\n}", "video": "" }
{ "audio": "", "image": "", "text": "func NextPlus(z, x *decimal.Big) *decimal.Big {\n\tif z.CheckNaNs(x, nil) {\n\t\treturn z\n\t}\n\n\tif x.IsInf(0) {\n\t\tif x.IsInf(+1) {\n\t\t\treturn z.SetInf(false)\n\t\t}\n\t\t_, m := decimal.Raw(z)\n\t\tmaxfor(m, precision(z), -1)\n\t\treturn z.SetBigMantScale(m, -etop(z)...
{ "audio": "", "image": "", "text": "\tctx.RoundingMode = decimal.ToPositiveInf\n\tctx.Set(z, x)\n\tctx.Add(z, x, new(decimal.Big).SetMantScale(1, -etiny(z)+1))\n\tz.Context.Conditions &= ctx.Conditions\n\treturn z\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tif z.skipWhiteSpace(); z.err != nil {\n\t\tz.data.start = z.raw.end\n\t\tz.data.end = z.raw.end\n\t\treturn true\n\t}\n\tz.readUntilCloseAngle()\n\treturn true\n}", "video": "" }
{ "audio": "", "image": "", "text": "func SetSignbit(z *decimal.Big, sign bool) *decimal.Big", "video": "" }
{ "audio": "", "image": "", "text": " {\n\tif sign {\n\t\treturn z.CopySign(z, neg)\n\t}\n\treturn z.CopySign(z, pos)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tif z.skipWhiteSpace(); z.err != nil {\n\t\tz.data.start = z.raw.end\n\t\tz.data.end = z.raw.end\n\t\treturn true\n\t}\n\tz.readUntilCloseAngle()\n\treturn true\n}", "video": "" }
{ "audio": "", "image": "", "text": "func Wallis(z *decimal.Big, g Generator) *decimal.Big {\n\tif !g.Next() {\n\t\treturn z\n\t}\n\n\tws, ok := g.(Walliser)\n\tif !ok {\n\t\tws = walliser{prec: precision(z) + 5}\n\t}\n\ta, a_1, b, b_1, p, eps := ws.Wallis()\n\n\tt := g.Term()\n\n\ta_1.SetUint64(1)\n\ta.Copy(t.B)...
{ "audio": "", "image": "", "text": "\n\t\tctx.FMA(a, a, t.B, ctx.Mul(a_1, a_1, t.A))\n\t\ta_1.Copy(z)\n\n\t\tz.Copy(b)\n\t\tctx.FMA(b, b, t.B, ctx.Mul(b_1, b_1, t.A))\n\t\tb_1.Copy(z)\n\n\t\tctx.Quo(z, a, b)\n\t\tif ctx.Sub(p, z, p).CmpAbs(eps) <= 0 {\n\t\t\tbreak\n\t\t}\n\t\tp.Copy(z)\n\t}\n\treturn z\n}", "v...
{ "audio": "", "image": "", "text": " gid := range g.Tables() {\n\t\tt := g.Table(gid)\n\t\tb.g.tables[gid] = t\n\t\tif b.colTypes == nil {\n\t\t\tb.colTypes = colTypes(t)\n\t\t}\n\t}\n\treturn &b\n}", "video": "" }
{ "audio": "", "image": "", "text": "func ParseCases(r io.Reader) (cases []Case, err error) {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanLines)\n\n\tfor s.Scan() {\n\t\tp := s.Bytes()\n\t", "video": "" }
{ "audio": "", "image": "", "text": "\t// Skip empty lines and comments.\n\t\tif len(p) == 0 || p[0] == '#' {\n\t\t\tcontinue\n\t\t}\n\n\t\tc, err := ParseCase(p)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcases = append(cases, c)\n\t}\n\treturn cases, s.Err()\n}", "video": "" }
{ "audio": "", "image": "", "text": " is := r.(*bufio.Reader); is {\n\t\treturn r\n\t}\n\n\treturn bufio.NewReader(r)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c Case) ShortString(length int) string {\n\treturn fmt.Sprintf(\"%s%d [%s, %s]: %s(%s) = %s %s\",\n\t\tc.Prefix, c.Prec, c.Trap, c.Mode,", "video": "" }
{ "audio": "", "image": "", "text": " c.Op,\n\t\tjoin(c.Inputs, \", \", length), trunc(c.Output, length), c.Excep)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\t\tc.firewallRules = append(c.firewallRules[:i], c.firewallRules[i+1:]...)\n\t\t\treturn nil\n\t\t}\n\t}\n\n\treturn fmt.Errorf(\"Firewall rule %s not found\", fwRuleID)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (i Data) IsNaN() (nan, signal bool) {\n\tif len(i) == 1 {\n\t\treturn (i == \"S\" || i == \"Q\"), i == \"S\"\n\t}\n\tif i[0] == '-' {", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\ti = i[1:]\n\t}\n\treturn strings.EqualFold(string(i), \"nan\") ||\n\t\tstrings.EqualFold(string(i), \"qnan\") ||\n\t\tstrings.EqualFold(string(i), \"snan\"), i[0] == 's' || i[0] == 'S'\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\t\tif fmt.Sprintf(\"%v\", i.Value) == val {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (i Data) IsInf() (int, bool) {\n\tif len(i) != 4 {\n\t\treturn 0, false\n\t}\n\tif strings.EqualFold(string(i), \"-Inf\") {\n\t\treturn -1, true\n\t}", "video": "" }
{ "audio": "", "image": "", "text": "\n\tif strings.EqualFold(string(i), \"+Inf\") {\n\t\treturn +1, true\n\t}\n\treturn 0, false\n}", "video": "" }
{ "audio": "", "image": "", "text": " false\n\t}\n\tfor i := 0; i < len(cu); i++ {\n\t\tif cu[i] != o[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (z *Big) CheckNaNs(x, y *Big) bool {\n\treturn", "video": "" }
{ "audio": "", "image": "", "text": " z.invalidContext(z.Context) || z.checkNaNs(x, y, 0)\n}", "video": "" }
{ "audio": "", "image": "", "text": " crypto.Addressable, power *big.Int) error {\n\t\treturn AddPower(vs, id.GetPublicKey(), power)\n\t})\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (z *Big) Abs(x *Big) *Big {\n\tif debug {\n\t\tx.validate()\n\t}\n\tif !z.invalidContext(z.Context)", "video": "" }
{ "audio": "", "image": "", "text": " && !z.checkNaNs(x, x, absvalue) {\n\t\tz.Context.round(z.copyAbs(x))\n\t}\n\treturn z\n}", "video": "" }
{ "audio": "", "image": "", "text": " crypto.Addressable, power *big.Int) error {\n\t\treturn AddPower(vs, id.GetPublicKey(), power)\n\t})\n}", "video": "" }
{ "audio": "", "image": "", "text": "func cmp(x, y *Big, abs bool) int {\n\tif debug {\n\t\tx.validate()\n\t\ty.validate()\n\t}\n\n\tif x == y {\n\t\treturn 0\n\t}\n\n\t// NaN cmp x\n\t// z cmp NaN\n\t// NaN cmp NaN\n\tif (x.form|y.form)&nan != 0 {\n\t\treturn 0\n\t}\n\n\t// Fast path: Catches non-finite forms li...
{ "audio": "", "image": "", "text": "\t\t\treturn +1\n\t\t}\n\t\treturn -1\n\t}\n\tswitch xs {\n\tcase 0, +2, -2:\n\t\treturn 0\n\tdefault:\n\t\tr := cmpabs(x, y)\n\t\tif xs < 0 && !abs {\n\t\t\tr = -r\n\t\t}\n\t\treturn r\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " out.Y <= min {\n\t\ty = min\n\t} else {\n\t\ty = max\n\t}\n\tx := in.X + dx*(y-in.Y)/dy\n\tp.X, p.Y = x, y\n\tp.DeltaX, p.DeltaY = math.NaN(), math.NaN()\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (z *Big) Copy(x *Big) *Big {\n\tif debug {\n\t\tx.validate()\n", "video": "" }
{ "audio": "", "image": "", "text": "\t}\n\tif z != x {\n\t\tsign := x.form & signbit\n\t\tz.copyAbs(x)\n\t\tz.form |= sign\n\t}\n\treturn z\n}", "video": "" }
{ "audio": "", "image": "", "text": " crypto.Addressable, power *big.Int) error {\n\t\treturn AddPower(vs, id.GetPublicKey(), power)\n\t})\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (z *Big) copyAbs(x *Big) *Big {\n\tif z != x {\n\t\tz.precision = x.Precision()\n\t\tz.exp = x.exp\n", "video": "" }
{ "audio": "", "image": "", "text": "\t\tz.compact = x.compact\n\t\tif x.IsFinite() && x.isInflated() {\n\t\t\tz.unscaled.Set(&x.unscaled)\n\t\t}\n\t}\n\tz.form = x.form & ^signbit\n\treturn z\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tif z.skipWhiteSpace(); z.err != nil {\n\t\tz.data.start = z.raw.end\n\t\tz.data.end = z.raw.end\n\t\treturn true\n\t}\n\tz.readUntilCloseAngle()\n\treturn true\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (z *Big) CopySign(x, y *Big) *Big {\n\tif debug {\n\t\tx.validate()\n\t\ty.validate()\n\t}\n\t// Pre-emptively capture signbit in case", "video": "" }
{ "audio": "", "image": "", "text": " z == y.\n\tsign := y.form & signbit\n\tz.copyAbs(x)\n\tz.form |= sign\n\treturn z\n}", "video": "" }
{ "audio": "", "image": "", "text": " out.Y <= min {\n\t\ty = min\n\t} else {\n\t\ty = max\n\t}\n\tx := in.X + dx*(y-in.Y)/dy\n\tp.X, p.Y = x, y\n\tp.DeltaX, p.DeltaY = math.NaN(), math.NaN()\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (x *Big) Float64() (f float64, ok bool) {\n\tif debug {\n\t\tx.validate()\n\t}\n\n\tif !x.IsFinite() {\n\t\tswitch x.form {\n\t\tcase pinf, ninf:\n\t\t\treturn math.Inf(int(x.form & signbit)), true\n\t\tcase snan, qnan:\n\t\t\treturn math.NaN(), true\n\t\tcase ssnan, sqna...
{ "audio": "", "image": "", "text": "\tok = xc < maxMantissa || (xc&(xc-1)) == 0\n\tcase x.exp == 0:\n\t\tf = float64(xc)\n\t\tok = xc < maxMantissa || (xc&(xc-1)) == 0\n\tcase x.exp > 0:\n\t\tf = float64(x.compact) * math.Pow10(x.exp)\n\t\tok = x.compact < maxMantissa && x.exp < maxPow10\n\tcase x.exp < 0:\n\t\t...
{ "audio": "", "image": "", "text": "\n\t} else {\n\t\tf.x = f.w + x\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (x *Big) Float(z *big.Float) *big.Float {\n\tif debug {\n\t\tx.validate()\n\t}\n\n\tif z == nil {\n\t\tz = new(big.Float)\n\t}\n\n\tswitch x.form {\n\tcase finite, finite | signbit:\n\t\tif x.isZero() {\n\t\t\tz.SetUint64(0)\n\t\t} else {\n", "video": "" }
{ "audio": "", "image": "", "text": "\t\t\tz.SetRat(x.Rat(nil))\n\t\t}\n\tcase pinf, ninf:\n\t\tz.SetInf(x.form == pinf)\n\tdefault: // snan, qnan, ssnan, sqnan:\n\t\tz.SetUint64(0)\n\t}\n\treturn z\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tz.digest = crc32.Update(z.digest, crc32.IEEETable, data)\n\t\thdr.Extra = data\n\t}\n\n\tvar s string\n\tif flg&flagName != 0 {\n\t\tif s, err = z.readString(); err != nil {\n\t\t\treturn hdr, err\n\t\t}\n\t\thdr.Name = s\n\t}\n\n\tif flg&flagComment != 0 {\n\t\tif s, err = ...
{ "audio": "", "image": "", "text": "func (x *Big) Int64() (int64, bool) {\n\tif debug {\n\t\tx.validate()\n\t}\n\n\tif !x.IsFinite() {\n\t\treturn 0, false\n\t}\n\n\t// x might be too large to fit into an int64 *now*, but rescaling x might\n\t// shrink it enough. See issue #20.\n\tif !x.isCompact() {\n\t\txb := ...
{ "audio": "", "image": "", "text": " u, ok = scalex(u, x.exp); !ok {\n\t\t\treturn 0, false\n\t\t}\n\t}\n\tsu := int64(u)\n\tif su >= 0 || x.Signbit() && su == -su {\n\t\tif x.Signbit() {\n\t\t\tsu = -su\n\t\t}\n\t\treturn su, true\n\t}\n\treturn 0, false\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t}\n\tvar x int64\n\tfor i := range b {\n\t\tx = (x << 8) + int64(b[i]&0xFF)\n\t}\n\treturn x, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (x *Big) Uint64() (uint64, bool) {\n\tif debug {\n\t\tx.validate()\n\t}\n\n\tif !x.IsFinite() || x.Signbit() {\n\t\treturn 0, false\n\t}\n\n\t// x might be too large to fit into an uint64 *now*, but rescaling x might\n\t// shrink it enough. See issue #20.\n\tif !x.isCompa...
{ "audio": "", "image": "", "text": " {\n\t\txb := x.Int(nil)\n\t\treturn xb.Uint64(), xb.IsUint64()\n\t}\n\n\tb := x.compact\n\tif x.exp == 0 {\n\t\treturn b, true\n\t}\n\treturn scalex(b, x.exp)\n}", "video": "" }
{ "audio": "", "image": "", "text": " len(x.Children))\n\n\tfor i := range x.Children {\n\t\tret[i] = x.Children[i]\n\t}\n\n\treturn ret\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (x *Big) IsNormal() bool {\n\treturn x.IsFinite() &&", "video": "" }
{ "audio": "", "image": "", "text": " x.adjusted() >= x.Context.minScale()\n}", "video": "" }
{ "audio": "", "image": "", "text": " len(x.Children))\n\n\tfor i := range x.Children {\n\t\tret[i] = x.Children[i]\n\t}\n\n\treturn ret\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (x *Big) IsSubnormal() bool {\n\treturn x.IsFinite() &&", "video": "" }
{ "audio": "", "image": "", "text": " x.adjusted() < x.Context.minScale()\n}", "video": "" }
{ "audio": "", "image": "", "text": " len(x.Children))\n\n\tfor i := range x.Children {\n\t\tret[i] = x.Children[i]\n\t}\n\n\treturn ret\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (x *Big) IsInt() bool {\n\tif debug {\n\t\tx.validate()\n\t}\n\n\tif !x.IsFinite() {\n\t\treturn false\n\t}\n\n\t// 0, 5000, 40\n\tif x.isZero() || x.exp >= 0 {\n\t\treturn true\n\t}\n\n\txp := x.Precision()\n\texp := x.exp\n\n\t// 0.001\n\t// 0.5\n\tif -exp >= xp {\n\t\t...
{ "audio": "", "image": "", "text": " x.unscaled if we know for a fact it's not\n\t\t// an integer.\n\t} else if x.unscaled.Bit(0) == 0 {\n\t\tv := new(big.Int).Set(&x.unscaled)\n\t\tr := new(big.Int)\n\t\tfor {\n\t\t\tv.QuoRem(v, c.TenInt, r)\n\t\t\tif r.Sign() != 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\texp++\n\t\t}\...
{ "audio": "", "image": "", "text": " len(x.Children))\n\n\tfor i := range x.Children {\n\t\tret[i] = x.Children[i]\n\t}\n\n\treturn ret\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (z *Big) Neg(x *Big) *Big {\n\tif debug {\n\t\tx.validate()\n\t}\n\tif !z.invalidContext(z.Context) && !z.checkNaNs(x, x, negation) {\n\t\txform := x.form // copy in case z == x\n\t\tz.copyAbs(x)\n\t\tif !z.IsFinite() || z.compact", "video": "" }
{ "audio": "", "image": "", "text": " != 0 || z.Context.RoundingMode == ToNegativeInf {\n\t\t\tz.form = xform ^ signbit\n\t\t}\n\t}\n\treturn z.Context.round(z)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tif z.skipWhiteSpace(); z.err != nil {\n\t\tz.data.start = z.raw.end\n\t\tz.data.end = z.raw.end\n\t\treturn true\n\t}\n\tz.readUntilCloseAngle()\n\treturn true\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (x *Big) Precision() int {\n\t// Cannot call validate since validate calls this method.\n\tif !x.IsFinite() {\n\t\treturn", "video": "" }
{ "audio": "", "image": "", "text": " 0\n\t}\n\tif x.precision == 0 {\n\t\treturn 1\n\t}\n\treturn x.precision\n}", "video": "" }
{ "audio": "", "image": "", "text": " NewArithmeticConstraint(FUNC_OP, []Attribute{a1, a2},\n\t\t\tfunc(x []int) int {\n\t\t\t\treturn fn(x[0], x[1])\n\t\t\t})\n\t} else {\n\t\treturn NewArithmeticConstraint(SUB_OP, []Attribute{a1, a2}, nil)\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (x *Big) Rat(z *big.Rat) *big.Rat {\n\tif debug {\n\t\tx.validate()\n\t}\n\n\tif z == nil {\n\t\tz = new(big.Rat)\n\t}\n\n\tif !x.IsFinite() {\n\t\treturn z.SetInt64(0)\n\t}\n\n\t// Fast path for decimals <= math.MaxInt64.\n\tif x.IsInt() {\n\t\tif u, ok := x.Int64(); ok ...
{ "audio": "", "image": "", "text": "\t}\n\tif x.exp > 0 {\n\t\tarith.MulBigPow10(num, num, uint64(x.exp))\n\t}\n\tif x.Signbit() {\n\t\tnum.Neg(num)\n\t}\n\n\tdenom := c.OneInt\n\tif x.exp < 0 {\n\t\tdenom = new(big.Int)\n\t\tif shift, ok := arith.Pow10(uint64(-x.exp)); ok {\n\t\t\tdenom.SetUint64(shift)\n\t\t} ...
{ "audio": "", "image": "", "text": "\n\t}\n\tvar x int64\n\tfor i := range b {\n\t\tx = (x << 8) + int64(b[i]&0xFF)\n\t}\n\treturn x, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (z *Big) Scan(state fmt.ScanState, verb rune) error {", "video": "" }
{ "audio": "", "image": "", "text": "\n\treturn z.scan(byteReader{state})\n}", "video": "" }
{ "audio": "", "image": "", "text": " crypto.Addressable, power *big.Int) error {\n\t\treturn AddPower(vs, id.GetPublicKey(), power)\n\t})\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (z *Big) SetBigMantScale(value *big.Int, scale int) *Big {\n\t// Do this first in case value == z.unscaled. Don't want to clobber the sign.\n\tz.form = finite\n\tif value.Sign() < 0 {\n\t\tz.form |= signbit\n\t}\n\n\tz.unscaled.Abs(value)\n\tz.compact = c.Inflated\n", "...
{ "audio": "", "image": "", "text": "\tz.precision = arith.BigLength(value)\n\n\tif z.unscaled.IsUint64() {\n\t\tif v := z.unscaled.Uint64(); v != c.Inflated {\n\t\t\tz.compact = v\n\t\t}\n\t}\n\n\tz.exp = -scale\n\treturn z\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tif z.skipWhiteSpace(); z.err != nil {\n\t\tz.data.start = z.raw.end\n\t\tz.data.end = z.raw.end\n\t\treturn true\n\t}\n\tz.readUntilCloseAngle()\n\treturn true\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (z *Big) SetFloat(x *big.Float) *Big {\n\tif x.IsInf() {\n\t\tif x.Signbit() {\n\t\t\tz.form = ninf\n\t\t} else {\n\t\t\tz.form = pinf\n\t\t}\n\t\treturn z\n\t}\n\n\tneg := x.Signbit()\n\tif x.Sign() == 0 {\n\t\tif neg {\n\t\t\tz.form |= signbit\n\t\t}\n\t\tz.compact = 0\...
{ "audio": "", "image": "", "text": " acc == big.Exact {\n\t\tz.compact = mant\n\t\tz.precision = arith.Length(mant)\n\t} else {\n\t\tz.compact = c.Inflated\n\t\tx0.Int(&z.unscaled)\n\t\tz.precision = arith.BigLength(&z.unscaled)\n\t}\n\tz.form = finite\n\tif neg {\n\t\tz.form |= signbit\n\t}\n\treturn z\n}", "...
{ "audio": "", "image": "", "text": "\tz.digest = crc32.Update(z.digest, crc32.IEEETable, data)\n\t\thdr.Extra = data\n\t}\n\n\tvar s string\n\tif flg&flagName != 0 {\n\t\tif s, err = z.readString(); err != nil {\n\t\t\treturn hdr, err\n\t\t}\n\t\thdr.Name = s\n\t}\n\n\tif flg&flagComment != 0 {\n\t\tif s, err = ...
{ "audio": "", "image": "", "text": "func (z *Big) SetFloat64(x float64) *Big {\n\tif x == 0 {\n\t\tvar sign form\n\t\tif math.Signbit(x) {\n\t\t\tsign = signbit\n\t\t}\n\t\treturn z.setZero(sign, 0)\n\t}\n\tif math.IsNaN(x) {\n\t\tvar sign form\n\t\tif math.Signbit(x) {\n\t\t\tsign = signbit\n\t\t}\n\t\treturn z...
{ "audio": "", "image": "", "text": "\n\t\tmantissa >>= 1\n\t\tshift--\n\t}\n\n\tz.exp = 0\n\tz.form = finite | form(bits>>63)\n\n\tif shift > 0 {\n\t\tz.unscaled.SetUint64(uint64(shift))\n\t\tz.unscaled.Exp(c.FiveInt, &z.unscaled, nil)\n\t\tarith.Mul(&z.unscaled, &z.unscaled, mantissa)\n\t\tz.exp = -shift\n\t} e...
{ "audio": "", "image": "", "text": " {\n\t\tΔ := float64(v) - avg\n\t\tvariance += Δ * Δ\n\t}\n\n\tstddev := math.Sqrt(float64(variance)) / float64(len(b))\n\texp := math.Sqrt(1 / float64(len(b)))\n\n\t// Subtract expected stddev\n\tstddev -= exp\n\tif stddev < 0 {\n\t\tstddev = 0\n\t}\n\tstddev *= 1 + exp\n\n\t...
{ "audio": "", "image": "", "text": "func (z *Big) SetInf(signbit bool) *Big {\n\tif signbit {\n\t\tz.form = ninf\n\t}", "video": "" }
{ "audio": "", "image": "", "text": " else {\n\t\tz.form = pinf\n\t}\n\treturn z\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tif z.skipWhiteSpace(); z.err != nil {\n\t\tz.data.start = z.raw.end\n\t\tz.data.end = z.raw.end\n\t\treturn true\n\t}\n\tz.readUntilCloseAngle()\n\treturn true\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (z *Big) SetMantScale(value int64, scale int) *Big {\n\tz.SetUint64(arith.Abs(value))\n\tz.exp = -scale // compiler should optimize out", "video": "" }
{ "audio": "", "image": "", "text": " z.exp = 0 in SetUint64\n\tif value < 0 {\n\t\tz.form |= signbit\n\t}\n\treturn z\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tif z.skipWhiteSpace(); z.err != nil {\n\t\tz.data.start = z.raw.end\n\t\tz.data.end = z.raw.end\n\t\treturn true\n\t}\n\tz.readUntilCloseAngle()\n\treturn true\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (z *Big) setNaN(c Condition, f form, p Payload) *Big {\n\tz.form = f\n\tz.compact = uint64(p)\n\tz.Context.Conditions |= c\n\tif z.Context.OperatingMode == Go", "video": "" }
{ "audio": "", "image": "", "text": " {\n\t\tpanic(ErrNaN{Msg: z.Context.Conditions.String()})\n\t}\n\treturn z\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tif z.skipWhiteSpace(); z.err != nil {\n\t\tz.data.start = z.raw.end\n\t\tz.data.end = z.raw.end\n\t\treturn true\n\t}\n\tz.readUntilCloseAngle()\n\treturn true\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (z *Big) SetNaN(signal bool) *Big {\n\tif signal {\n\t\tz.form = snan\n\t} else {\n", "video": "" }
{ "audio": "", "image": "", "text": "\t\tz.form = qnan\n\t}\n\tz.compact = 0 // payload\n\treturn z\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tz.digest = crc32.Update(z.digest, crc32.IEEETable, data)\n\t\thdr.Extra = data\n\t}\n\n\tvar s string\n\tif flg&flagName != 0 {\n\t\tif s, err = z.readString(); err != nil {\n\t\t\treturn hdr, err\n\t\t}\n\t\thdr.Name = s\n\t}\n\n\tif flg&flagComment != 0 {\n\t\tif s, err = ...
{ "audio": "", "image": "", "text": "func (z *Big) SetRat(x *big.Rat) *Big {\n\tif x.IsInt() {\n\t\treturn z.Context.round(z.SetBigMantScale(x.Num(), 0))\n\t}\n\tvar num, denom Big\n", "video": "" }
{ "audio": "", "image": "", "text": "\tnum.SetBigMantScale(x.Num(), 0)\n\tdenom.SetBigMantScale(x.Denom(), 0)\n\treturn z.Quo(&num, &denom)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tz.digest = crc32.Update(z.digest, crc32.IEEETable, data)\n\t\thdr.Extra = data\n\t}\n\n\tvar s string\n\tif flg&flagName != 0 {\n\t\tif s, err = z.readString(); err != nil {\n\t\t\treturn hdr, err\n\t\t}\n\t\thdr.Name = s\n\t}\n\n\tif flg&flagComment != 0 {\n\t\tif s, err = ...
{ "audio": "", "image": "", "text": "func (z *Big) SetScale(scale int) *Big {\n", "video": "" }
{ "audio": "", "image": "", "text": "\tz.exp = -scale\n\treturn z\n}", "video": "" }
{ "audio": "", "image": "", "text": " crypto.Addressable, power *big.Int) error {\n\t\treturn AddPower(vs, id.GetPublicKey(), power)\n\t})\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (x *Big) ord(abs bool) int {\n\tif x.form&inf != 0 {\n\t\tif x.form == pinf || abs {\n\t\t\treturn +2\n\t\t}\n\t\treturn -2\n\t}", "video": "" }
{ "audio": "", "image": "", "text": "\n\tr := x.Sign()\n\tif abs && r < 0 {\n\t\tr = -r\n\t}\n\treturn r\n}", "video": "" }
{ "audio": "", "image": "", "text": " len(x.Children))\n\n\tfor i := range x.Children {\n\t\tret[i] = x.Children[i]\n\t}\n\n\treturn ret\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (x *Big) Signbit() bool {\n\tif debug", "video": "" }
{ "audio": "", "image": "", "text": " {\n\t\tx.validate()\n\t}\n\treturn x.form&signbit != 0\n}", "video": "" }
{ "audio": "", "image": "", "text": " bool {\n\treturn func(err error) bool {\n\t\treturn Cause(err) == cause\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (x *Big) String() string {\n\tif x == nil {\n\t\treturn \"<nil>\"\n\t}\n\tvar (\n\t\tb = new(strings.Builder)\n\t\tf = formatter{w: b, prec: x.Precision(), width: noWidth}\n\t\te", "video": "" }
{ "audio": "", "image": "", "text": " = sciE[x.Context.OperatingMode]\n\t)\n\tb.Grow(x.Precision())\n\tf.format(x, normal, e)\n\treturn b.String()\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t}\n\tvar x int64\n\tfor i := range b {\n\t\tx = (x << 8) + int64(b[i]&0xFF)\n\t}\n\treturn x, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (x *Big) validate() {\n\tdefer func() {\n\t\tif err := recover(); err != nil {\n\t\t\tpc, _, _, ok := runtime.Caller(4)\n\t\t\tif caller := runtime.FuncForPC(pc); ok && caller != nil {\n\t\t\t\tfmt.Println(\"called by:\", caller.Name())\n\t\t\t}\n\t\t\ttype Big struct {\n...
{ "audio": "", "image": "", "text": " {\n\t\t\tif x.unscaled.IsUint64() && x.unscaled.Uint64() != c.Inflated {\n\t\t\t\tpanic(fmt.Sprintf(\"inflated but unscaled == %d\", x.unscaled.Uint64()))\n\t\t\t}\n\t\t\tif x.unscaled.Sign() < 0 {\n\t\t\t\tpanic(\"x.unscaled.Sign() < 0\")\n\t\t\t}\n\t\t\tif bl, xp := arith.B...
{ "audio": "", "image": "", "text": " NewArithmeticConstraint(FUNC_OP, []Attribute{a1, a2},\n\t\t\tfunc(x []int) int {\n\t\t\t\treturn fn(x[0], x[1])\n\t\t\t})\n\t} else {\n\t\treturn NewArithmeticConstraint(SUB_OP, []Attribute{a1, a2}, nil)\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func Digits(digits int) string {\n\tmax := int(math.Pow10(digits)) - 1\n\tnum := privateRand.Intn(max)\n", "video": "" }
{ "audio": "", "image": "", "text": "\tformat := fmt.Sprintf(\"%%0%dd\", digits)\n\treturn fmt.Sprintf(format, num)\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\treturn int(math.Max(-math.Floor(math.Log10(div)), 0))\n}", "video": "" }
{ "audio": "", "image": "", "text": "func BoundedDigits(digits, low, high int) string {\n\tif low > high {\n\t\tlow, high = high, low\n\t}\n\n\tmax := int(math.Pow10(digits)) - 1\n\tif high > max {\n\t\thigh = max\n\t}\n\n\tnum", "video": "" }
{ "audio": "", "image": "", "text": " := privateRand.Intn(high-low+1) + low\n\tformat := fmt.Sprintf(\"%%0%dd\", digits)\n\treturn fmt.Sprintf(format, num)\n}", "video": "" }
{ "audio": "", "image": "", "text": " int32) (low, high int64, err error) {\n\treturn getWatermarkOffsets(c, topic, partition)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func Title(gender int) string {\n\tvar title = \"\"\n\tswitch gender {\n\tcase Male:\n\t\ttitle = randomFrom(jsonData.MaleTitles)\n\t\tbreak\n\tcase Female:\n\t\ttitle", "video": "" }
{ "audio": "", "image": "", "text": " = randomFrom(jsonData.FemaleTitles)\n\t\tbreak\n\tdefault:\n\t\ttitle = FirstName(privateRand.Intn(2))\n\t\tbreak\n\t}\n\treturn title\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\t\t\tlog.Println(err)\n\t\t}\n\n\t\tsong.Artist = zingResponse.Artist\n\t\tsong.Title = zingResponse.Title\n\t\tsong.StreamURL = zingResponse.Source.Url\n\n\t\tlistSong = append(listSong, song)\n\t}\n\treturn listSong\n}", "video": "" }
{ "audio": "", "image": "", "text": "func FirstName(gender int) string {\n\tvar name = \"\"\n\tswitch gender {\n\tcase Male:\n\t\tname = randomFrom(jsonData.FirstNamesMale)\n\t\tbreak\n\tcase Female:\n\t\tname", "video": "" }
{ "audio": "", "image": "", "text": " = randomFrom(jsonData.FirstNamesFemale)\n\t\tbreak\n\tdefault:\n\t\tname = FirstName(rand.Intn(2))\n\t\tbreak\n\t}\n\treturn name\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\t\to.pkgauthor = parts[1]\n\t\to.Name(parts[2])\n\t\tswitch parts[0] {\n\t\tcase \"github.com\", \"bitbucket.org\":\n\t\t\to.pkgrepo = \"https://\" + strings.Join(parts[0:3], \"/\")\n\t\t}\n\t}\n\n\treturn o\n}", "video": "" }