Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for NumError (0.11 sec)

  1. src/strconv/atoi_test.go

    		if test.err != nil {
    			test.err = &NumError{"ParseUint", test.in, test.err}
    		}
    	}
    	for i := range parseUint64BaseTests {
    		test := &parseUint64BaseTests[i]
    		if test.err != nil {
    			test.err = &NumError{"ParseUint", test.in, test.err}
    		}
    	}
    	for i := range parseInt64Tests {
    		test := &parseInt64Tests[i]
    		if test.err != nil {
    			test.err = &NumError{"ParseInt", test.in, test.err}
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 21 05:09:21 UTC 2023
    - 17.1K bytes
    - Viewed (0)
  2. 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)
  3. src/strconv/atof.go

    // (Parsing a hexadecimal floating-point value only rounds when
    // there are more bits in the hexadecimal representation than
    // will fit in the mantissa.)
    //
    // The errors that ParseFloat returns have concrete type *NumError
    // and include err.Num = s.
    //
    // If s is not syntactically well-formed, ParseFloat returns err.Err = ErrSyntax.
    //
    // If s is syntactically well-formed but is more than 1/2 ULP
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 06 18:50:50 UTC 2022
    - 15.9K bytes
    - Viewed (0)
  4. src/strconv/atof_test.go

    	for i := range atoftests {
    		test := &atoftests[i]
    		if test.err != nil {
    			test.err = &NumError{"ParseFloat", test.in, test.err}
    		}
    	}
    	for i := range atof32tests {
    		test := &atof32tests[i]
    		if test.err != nil {
    			test.err = &NumError{"ParseFloat", test.in, test.err}
    		}
    	}
    
    	// Generate random inputs for tests and benchmarks
    	if testing.Short() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 26 16:24:57 UTC 2022
    - 23.6K bytes
    - Viewed (0)
  5. 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)
  6. 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)
  7. 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)
Back to top