- Sort Score
- Result 10 results
- Languages All
Results 1 - 9 of 9 for NumError (0.14 sec)
-
src/strconv/atoi.go
func syntaxError(fn, str string) *NumError { return &NumError{fn, stringslite.Clone(str), ErrSyntax} } func rangeError(fn, str string) *NumError { return &NumError{fn, stringslite.Clone(str), ErrRange} } func baseError(fn, str string, base int) *NumError { return &NumError{fn, stringslite.Clone(str), errors.New("invalid base " + Itoa(base))} }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sun May 05 00:24:26 UTC 2024 - 8.3K bytes - Viewed (0) -
src/strconv/atoc.go
const fnParseComplex = "ParseComplex" // convErr splits an error returned by parseFloatPrefix // into a syntax or range error for ParseComplex. func convErr(err error, s string) (syntax, range_ error) { if x, ok := err.(*NumError); ok { x.Func = fnParseComplex x.Num = stringslite.Clone(s) if x.Err == ErrRange { return nil, x } } return err, nil } // ParseComplex converts the string s to a complex number
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sun May 05 00:24:26 UTC 2024 - 3.1K bytes - Viewed (0) -
src/flag/flag.go
// errRange is returned by Set if a flag's value is out of range. // It then gets wrapped through failf to provide more information. var errRange = errors.New("value out of range") func numError(err error) error { ne, ok := err.(*strconv.NumError) if !ok { return err } if ne.Err == strconv.ErrSyntax { return errParse } if ne.Err == strconv.ErrRange { return errRange } return err }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 07 18:38:24 UTC 2024 - 39.7K bytes - Viewed (0) -
src/database/sql/convert.go
return nil } } return fmt.Errorf("unsupported Scan, storing driver.Value type %T into type %T", src, dest) } func strconvErr(err error) error { if ne, ok := err.(*strconv.NumError); ok { return ne.Err } return err } func asString(src any) string { switch v := src.(type) { case string: return v case []byte: return string(v) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 29 17:58:53 UTC 2024 - 16.2K bytes - Viewed (0) -
src/fmt/scan.go
f, err := strconv.ParseFloat(str[:p], n) if err != nil { // Put full string into error. if e, ok := err.(*strconv.NumError); ok { e.Num = str } s.error(err) } m, err := strconv.Atoi(str[p+1:]) if err != nil { // Put full string into error. if e, ok := err.(*strconv.NumError); ok { e.Num = str } s.error(err) } return math.Ldexp(f, m) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 21:56:20 UTC 2024 - 31.9K bytes - Viewed (0) -
src/flag/flag_test.go
_ = fs.Int64("int64", 0, "") _ = fs.Uint("uint", 0, "") _ = fs.Uint64("uint64", 0, "") _ = fs.Float64("float64", 0, "") // Strings cannot give errors, and bools and durations do not return strconv.NumError. err := fs.Parse([]string{arg}) if err == nil { t.Errorf("Parse(%q)=%v; expected range error", arg, err) continue }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 07 18:38:24 UTC 2024 - 22K bytes - Viewed (0) -
src/math/big/int_test.go
var x Int _, ok := x.SetString(s, 0) if !ok { t.Errorf("SetString(%s, 0) failed", s) continue } want, err := strconv.ParseInt(s, 0, 64) if err != nil { if err.(*strconv.NumError).Err == strconv.ErrRange { if x.IsInt64() { t.Errorf("IsInt64(%s) succeeded unexpectedly", s) } } else { t.Errorf("ParseInt(%s) failed", s) } continue }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 18:42:28 UTC 2024 - 58.5K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go
{"FormatInt", Func, 0}, {"FormatUint", Func, 0}, {"IntSize", Const, 0}, {"IsGraphic", Func, 6}, {"IsPrint", Func, 0}, {"Itoa", Func, 0}, {"NumError", Type, 0}, {"NumError.Err", Field, 0}, {"NumError.Func", Field, 0}, {"NumError.Num", Field, 0}, {"ParseBool", Func, 0}, {"ParseComplex", Func, 15}, {"ParseFloat", Func, 0}, {"ParseInt", Func, 0}, {"ParseUint", Func, 0},
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 534.2K bytes - Viewed (0) -
src/net/http/h2_bundle.go
if n1 < n || n1 > maxVal { // n+v overflows n = 1<<64 - 1 err = strconv.ErrRange goto Error } n = n1 } return n, nil Error: return n, &strconv.NumError{Func: "ParseUint", Num: string(s0), Err: err} } // Return the first number n such that n*base >= 1<<64. func http2cutoff64(base int) uint64 { if base < 2 { return 0 }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jun 04 16:19:04 UTC 2024 - 364.1K bytes - Viewed (0)