Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for float64Value (0.91 sec)

  1. src/log/slog/value_test.go

    		t.Errorf("got %q, want %q", got, want)
    	}
    }
    
    func TestValueEqual(t *testing.T) {
    	var x, y int
    	vals := []Value{
    		{},
    		Int64Value(1),
    		Int64Value(2),
    		Float64Value(3.5),
    		Float64Value(3.7),
    		BoolValue(true),
    		BoolValue(false),
    		TimeValue(testTime),
    		TimeValue(time.Time{}),
    		TimeValue(time.Date(2001, 1, 2, 3, 4, 5, 0, time.UTC)),
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:12:08 UTC 2024
    - 6.9K bytes
    - Viewed (0)
  2. src/log/slog/value.go

    }
    
    // Uint64Value returns a [Value] for a uint64.
    func Uint64Value(v uint64) Value {
    	return Value{num: v, any: KindUint64}
    }
    
    // Float64Value returns a [Value] for a floating-point number.
    func Float64Value(v float64) Value {
    	return Value{num: math.Float64bits(v), any: KindFloat64}
    }
    
    // BoolValue returns a [Value] for a bool.
    func BoolValue(v bool) Value {
    	u := uint64(0)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:12:08 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  3. src/flag/flag.go

    // -- float64 Value
    type float64Value float64
    
    func newFloat64Value(val float64, p *float64) *float64Value {
    	*p = val
    	return (*float64Value)(p)
    }
    
    func (f *float64Value) Set(s string) error {
    	v, err := strconv.ParseFloat(s, 64)
    	if err != nil {
    		err = numError(err)
    	}
    	*f = float64Value(v)
    	return err
    }
    
    func (f *float64Value) Get() any { return float64(*f) }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 18:38:24 UTC 2024
    - 39.7K bytes
    - Viewed (0)
  4. src/database/sql/convert_test.go

    		}
    		if ct.wantf32 != 0 && ct.wantf32 != float32Value(ct.d) {
    			errf("want float32 %v, got %v", ct.wantf32, float32Value(ct.d))
    		}
    		if ct.wantf64 != 0 && ct.wantf64 != float64Value(ct.d) {
    			errf("want float32 %v, got %v", ct.wantf64, float64Value(ct.d))
    		}
    		if bp, boolTest := ct.d.(*bool); boolTest && *bp != ct.wantbool && ct.wanterr == "" {
    			errf("want bool %v, got %v", ct.wantbool, *bp)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 10 20:23:22 UTC 2024
    - 17K bytes
    - Viewed (0)
  5. src/fmt/scan.go

    }
    
    func hasX(s string) bool {
    	for i := 0; i < len(s); i++ {
    		if s[i] == 'x' || s[i] == 'X' {
    			return true
    		}
    	}
    	return false
    }
    
    // convertFloat converts the string to a float64value.
    func (s *ss) convertFloat(str string, n int) float64 {
    	// strconv.ParseFloat will handle "+0x1.fp+2",
    	// but we have to implement our non-standard
    	// decimal+binary exponent mix (1.2p4) ourselves.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 21:56:20 UTC 2024
    - 31.9K bytes
    - Viewed (0)
  6. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"DebugContext", Func, 21},
    		{"Default", Func, 21},
    		{"Duration", Func, 21},
    		{"DurationValue", Func, 21},
    		{"Error", Func, 21},
    		{"ErrorContext", Func, 21},
    		{"Float64", Func, 21},
    		{"Float64Value", Func, 21},
    		{"Group", Func, 21},
    		{"GroupValue", Func, 21},
    		{"Handler", Type, 21},
    		{"HandlerOptions", Type, 21},
    		{"HandlerOptions.AddSource", Field, 21},
    		{"HandlerOptions.Level", Field, 21},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
Back to top