Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for ParseFloatPrefix (0.2 sec)

  1. src/strconv/atof_test.go

    		for _, suffix := range []string{" ", "q", "+", "-", "<", "=", ">", "(", ")", "i", "init"} {
    			in := test.in + suffix
    			_, n, err := ParseFloatPrefix(in, 64)
    			if err != nil {
    				t.Errorf("ParseFloatPrefix(%q, 64): err = %v; want no error", in, err)
    			}
    			if n != len(test.in) {
    				t.Errorf("ParseFloatPrefix(%q, 64): n = %d; want %d", in, n, len(test.in))
    			}
    		}
    	}
    }
    
    func testAtof(t *testing.T, opt bool) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 26 16:24:57 UTC 2022
    - 23.6K bytes
    - Viewed (0)
  2. src/strconv/atof.go

    func ParseFloat(s string, bitSize int) (float64, error) {
    	f, n, err := parseFloatPrefix(s, bitSize)
    	if n != len(s) && (err == nil || err.(*NumError).Err != ErrSyntax) {
    		return 0, syntaxError(fnParseFloat, s)
    	}
    	return f, err
    }
    
    func parseFloatPrefix(s string, bitSize int) (float64, int, error) {
    	if bitSize == 32 {
    		f, n, err := atof32(s)
    		return float64(f), n, err
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 06 18:50:50 UTC 2022
    - 15.9K bytes
    - Viewed (0)
Back to top