Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 24 for AppendUint (0.32 sec)

  1. src/strconv/itoa_test.go

    					test.in, test.base, s, test.out)
    			}
    			x := AppendUint(nil, uint64(test.in), test.base)
    			if string(x) != test.out {
    				t.Errorf("AppendUint(%q, %v, %v) = %q want %v",
    					"abc", uint64(test.in), test.base, x, test.out)
    			}
    		}
    
    		if test.base == 10 && int64(int(test.in)) == test.in {
    			s := Itoa(int(test.in))
    			if s != test.out {
    				t.Errorf("Itoa(%v) = %v want %v",
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 15 21:09:39 UTC 2022
    - 5.8K bytes
    - Viewed (0)
  2. src/crypto/x509/oid.go

    		if valEnd {
    			if start == 0 {
    				if val < 80 {
    					b.Write(strconv.AppendUint(numBuf, val/40, 10))
    					b.WriteByte('.')
    					b.Write(strconv.AppendUint(numBuf, val%40, 10))
    				} else {
    					b.WriteString("2.")
    					b.Write(strconv.AppendUint(numBuf, val-80, 10))
    				}
    			} else {
    				b.Write(strconv.AppendUint(numBuf, val, 10))
    			}
    			val = 0
    			start = i + 1
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 19:10:38 UTC 2024
    - 8.3K bytes
    - Viewed (0)
  3. src/strconv/itoa.go

    	return dst
    }
    
    // AppendUint appends the string form of the unsigned integer i,
    // as generated by [FormatUint], to dst and returns the extended buffer.
    func AppendUint(dst []byte, i uint64, base int) []byte {
    	if fastSmalls && i < nSmalls && base == 10 {
    		return append(dst, small(int(i))...)
    	}
    	dst, _ = formatBits(dst, i, base, false, true)
    	return dst
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:21:28 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  4. src/strconv/doc.go

    //
    //	s := strconv.FormatBool(true)
    //	s := strconv.FormatFloat(3.1415, 'E', -1, 64)
    //	s := strconv.FormatInt(-42, 16)
    //	s := strconv.FormatUint(42, 16)
    //
    // [AppendBool], [AppendFloat], [AppendInt], and [AppendUint] are similar but
    // append the formatted value to a destination slice.
    //
    // # String Conversions
    //
    // [Quote] and [QuoteToASCII] convert strings to quoted Go string literals.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:21:28 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  5. src/log/slog/internal/benchmarks/handlers.go

    		buf.WriteString(v.String())
    	case slog.KindInt64:
    		*buf = strconv.AppendInt(*buf, v.Int64(), 10)
    	case slog.KindUint64:
    		*buf = strconv.AppendUint(*buf, v.Uint64(), 10)
    	case slog.KindFloat64:
    		*buf = strconv.AppendFloat(*buf, v.Float64(), 'g', -1, 64)
    	case slog.KindBool:
    		*buf = strconv.AppendBool(*buf, v.Bool())
    	case slog.KindDuration:
    		*buf = strconv.AppendInt(*buf, v.Duration().Nanoseconds(), 10)
    	case slog.KindTime:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 12 20:33:37 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  6. src/strconv/example_test.go

    	// Output:
    	// quote (ascii):"\"Fran & Freddie's Diner\""
    }
    
    func ExampleAppendUint() {
    	b10 := []byte("uint (base 10):")
    	b10 = strconv.AppendUint(b10, 42, 10)
    	fmt.Println(string(b10))
    
    	b16 := []byte("uint (base 16):")
    	b16 = strconv.AppendUint(b16, 42, 16)
    	fmt.Println(string(b16))
    
    	// Output:
    	// uint (base 10):42
    	// uint (base 16):2a
    }
    
    func ExampleAtoi() {
    	v := "10"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 22:57:37 UTC 2023
    - 8.9K bytes
    - Viewed (0)
  7. src/log/slog/json_handler.go

    }
    
    func appendJSONValue(s *handleState, v Value) error {
    	switch v.Kind() {
    	case KindString:
    		s.appendString(v.str())
    	case KindInt64:
    		*s.buf = strconv.AppendInt(*s.buf, v.Int64(), 10)
    	case KindUint64:
    		*s.buf = strconv.AppendUint(*s.buf, v.Uint64(), 10)
    	case KindFloat64:
    		// json.Marshal is funny about floats; it doesn't
    		// always match strconv.AppendFloat. So just call it.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 17 16:18:11 UTC 2023
    - 8.1K bytes
    - Viewed (0)
  8. src/time/format_rfc3339.go

    	year, month, day, _ := absDate(abs, true)
    	b = appendInt(b, year, 4)
    	b = append(b, '-')
    	b = appendInt(b, int(month), 2)
    	b = append(b, '-')
    	b = appendInt(b, day, 2)
    
    	b = append(b, 'T')
    
    	// Format time.
    	hour, min, sec := absClock(abs)
    	b = appendInt(b, hour, 2)
    	b = append(b, ':')
    	b = appendInt(b, min, 2)
    	b = append(b, ':')
    	b = appendInt(b, sec, 2)
    
    	if nanos {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 18 19:59:26 UTC 2023
    - 5.7K bytes
    - Viewed (0)
  9. test/fixedbugs/issue19359.go

    		if r := recover(); r != nil {
    			err = fmt.Errorf("addStr failed: %v", r)
    		}
    	}()
    	m[key] += "hello, go"
    	return nil
    }
    
    func appendInt(m map[interface{}][]int, key interface{}) (err error) {
    	defer func() {
    		if r := recover(); r != nil {
    			err = fmt.Errorf("appendInt failed: %v", r)
    		}
    	}()
    	m[key] = append(m[key], 2018)
    	return nil
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 20 01:47:07 UTC 2018
    - 1.9K bytes
    - Viewed (0)
  10. src/time/export_test.go

    	stdFracSecond9 | 7<<stdArgShift: ".9999999",
    	stdFracSecond9 | 8<<stdArgShift: ".99999999",
    	stdFracSecond9 | 9<<stdArgShift: ".999999999",
    }
    
    var Quote = quote
    
    var AppendInt = appendInt
    var AppendFormatAny = Time.appendFormat
    var AppendFormatRFC3339 = Time.appendFormatRFC3339
    var ParseAny = parse
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 24 19:23:32 UTC 2022
    - 4K bytes
    - Viewed (0)
Back to top