Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for rat (0.07 sec)

  1. src/math/big/rat.go

    import (
    	"fmt"
    	"math"
    )
    
    // A Rat represents a quotient a/b of arbitrary precision.
    // The zero value for a Rat represents the value 0.
    //
    // Operations always take pointer arguments (*Rat) rather
    // than Rat values, and each unique Rat value requires
    // its own unique *Rat pointer. To "copy" a Rat value,
    // an existing (or newly allocated) Rat must be set to
    // a new value using the [Rat.Set] method; shallow copies
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 11:59:09 UTC 2023
    - 13.5K bytes
    - Viewed (0)
  2. test/chan/powser2.go

    func i2tor(u, v int64) *rat {
    	g := gcd(u, v)
    	r := new(rat)
    	if v > 0 {
    		r.num = u / g
    		r.den = v / g
    	} else {
    		r.num = -u / g
    		r.den = -v / g
    	}
    	return r
    }
    
    func itor(u int64) *rat {
    	return i2tor(u, 1)
    }
    
    var zero *rat
    var one *rat
    
    // End mark and end test
    
    var finis *rat
    
    func end(u *rat) int64 {
    	if u.den == 0 {
    		return 1
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 25 22:22:20 UTC 2020
    - 13.3K bytes
    - Viewed (0)
  3. src/math/big/rat_test.go

    // when simply accessing the Rat value.
    func TestIssue34919(t *testing.T) {
    	for _, acc := range []struct {
    		name string
    		f    func(*Rat)
    	}{
    		{"Float32", func(x *Rat) { x.Float32() }},
    		{"Float64", func(x *Rat) { x.Float64() }},
    		{"Inv", func(x *Rat) { new(Rat).Inv(x) }},
    		{"Sign", func(x *Rat) { x.Sign() }},
    		{"IsInt", func(x *Rat) { x.IsInt() }},
    		{"Num", func(x *Rat) { x.Num() }},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jan 07 00:15:59 UTC 2022
    - 18.9K bytes
    - Viewed (0)
  4. test/chan/powser1.go

    func i2tor(u, v int64) rat {
    	g := gcd(u, v)
    	var r rat
    	if v > 0 {
    		r.num = u / g
    		r.den = v / g
    	} else {
    		r.num = -u / g
    		r.den = -v / g
    	}
    	return r
    }
    
    func itor(u int64) rat {
    	return i2tor(u, 1)
    }
    
    var zero rat
    var one rat
    
    // End mark and end test
    
    var finis rat
    
    func end(u rat) int64 {
    	if u.den == 0 {
    		return 1
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 25 22:22:20 UTC 2020
    - 12.7K bytes
    - Viewed (0)
  5. src/math/big/ratconv_test.go

    			}
    		}
    	}
    }
    
    func TestRatSetStringZero(t *testing.T) {
    	got, _ := new(Rat).SetString("0")
    	want := new(Rat).SetInt64(0)
    	if !reflect.DeepEqual(got, want) {
    		t.Errorf("got %#+v, want %#+v", got, want)
    	}
    }
    
    func TestRatScan(t *testing.T) {
    	var buf bytes.Buffer
    	for i, test := range setStringTests {
    		x := new(Rat)
    		buf.Reset()
    		buf.WriteString(test.in)
    
    		_, err := fmt.Fscanf(&buf, "%v", x)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 15 22:16:34 UTC 2023
    - 19.3K bytes
    - Viewed (0)
  6. src/math/big/ratconv.go

    // license that can be found in the LICENSE file.
    
    // This file implements rat-to-string conversion functions.
    
    package big
    
    import (
    	"errors"
    	"fmt"
    	"io"
    	"strconv"
    	"strings"
    )
    
    func ratTok(ch rune) bool {
    	return strings.ContainsRune("+-/0123456789.eE", ch)
    }
    
    var ratZero Rat
    var _ fmt.Scanner = &ratZero // *Rat must implement fmt.Scanner
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 15 22:16:34 UTC 2023
    - 12.3K bytes
    - Viewed (0)
  7. src/go/constant/value.go

    func (intVal) implementsValue()     {}
    func (floatVal) implementsValue()   {}
    func (complexVal) implementsValue() {}
    
    func newInt() *big.Int     { return new(big.Int) }
    func newRat() *big.Rat     { return new(big.Rat) }
    func newFloat() *big.Float { return new(big.Float).SetPrec(prec) }
    
    func i64toi(x int64Val) intVal   { return intVal{newInt().SetInt64(int64(x))} }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 34K bytes
    - Viewed (0)
  8. apache-maven/pom.xml

      </pluginRepositories>
    
      <build>
        <finalName>${distributionFileName}</finalName>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.rat</groupId>
              <artifactId>apache-rat-plugin</artifactId>
              <configuration>
                <excludes combine.children="append">
                  <exclude>src/assembly/maven/bin/m2.conf</exclude>
    Registered: Wed Jun 12 09:55:16 UTC 2024
    - Last Modified: Wed May 22 14:07:09 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  9. src/math/big/float.go

    		return nil, makeAcc(x.neg)
    	}
    
    	panic("unreachable")
    }
    
    // Rat returns the rational number corresponding to x;
    // or nil if x is an infinity.
    // The result is [Exact] if x is not an Inf.
    // If a non-nil *[Rat] argument z is provided, [Rat] stores
    // the result in z instead of allocating a new [Rat].
    func (x *Float) Rat(z *Rat) (*Rat, Accuracy) {
    	if debugFloat {
    		x.validate()
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 15:46:54 UTC 2024
    - 44.5K bytes
    - Viewed (0)
  10. docs/vi/docs/python-types.md

    Đây chỉ là một **hướng dẫn nhanh** về gợi ý kiểu dữ liệu trong Python. Nó chỉ bao gồm những điều cần thiết tối thiểu để sử dụng chúng với **FastAPI**... đó thực sự là rất ít.
    
    **FastAPI** hoàn toàn được dựa trên những gợi ý kiểu dữ liệu, chúng mang đến nhiều ưu điểm và lợi ích.
    
    Nhưng thậm chí nếu bạn không bao giờ sử dụng **FastAPI**, bạn sẽ được lợi từ việc học một ít về chúng.
    
    !!! note
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 21.9K bytes
    - Viewed (0)
Back to top