Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 2,939 for fmtX (0.1 sec)

  1. src/math/big/ftoa.go

    func (x *Float) Append(buf []byte, fmt byte, prec int) []byte {
    	// sign
    	if x.neg {
    		buf = append(buf, '-')
    	}
    
    	// Inf
    	if x.form == inf {
    		if !x.neg {
    			buf = append(buf, '+')
    		}
    		return append(buf, "Inf"...)
    	}
    
    	// pick off easy formats
    	switch fmt {
    	case 'b':
    		return x.fmtB(buf)
    	case 'p':
    		return x.fmtP(buf)
    	case 'x':
    		return x.fmtX(buf, prec)
    	}
    
    	// Algorithm:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 11:59:09 UTC 2023
    - 13.5K bytes
    - Viewed (0)
  2. src/strconv/ftoa.go

    		mant |= uint64(1) << flt.mantbits
    	}
    	exp += flt.bias
    
    	// Pick off easy binary, hex formats.
    	if fmt == 'b' {
    		return fmtB(dst, neg, mant, exp, flt)
    	}
    	if fmt == 'x' || fmt == 'X' {
    		return fmtX(dst, prec, fmt, neg, mant, exp, flt)
    	}
    
    	if !optimize {
    		return bigFtoa(dst, prec, fmt, neg, mant, exp, flt)
    	}
    
    	var digs decimalSlice
    	ok := false
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:21:28 UTC 2024
    - 13.9K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/ir/fmt.go

    		fmt.Fprint(s, "[")
    		if n.Low != nil {
    			fmt.Fprint(s, n.Low)
    		}
    		fmt.Fprint(s, ":")
    		if n.High != nil {
    			fmt.Fprint(s, n.High)
    		}
    		if n.Op().IsSlice3() {
    			fmt.Fprint(s, ":")
    			if n.Max != nil {
    				fmt.Fprint(s, n.Max)
    			}
    		}
    		fmt.Fprint(s, "]")
    
    	case OSLICEHEADER:
    		n := n.(*SliceHeaderExpr)
    		fmt.Fprintf(s, "sliceheader{%v,%v,%v}", n.Ptr, n.Len, n.Cap)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 05 15:20:28 UTC 2023
    - 26K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types/fmt.go

    //	%S	Short syntax: Name only, no matter what.
    func (s *Sym) Format(f fmt.State, verb rune) {
    	mode := fmtGo
    	switch verb {
    	case 'v', 'S':
    		if verb == 'v' && f.Flag('+') {
    			mode = fmtDebug
    		}
    		fmt.Fprint(f, sconv(s, verb, mode))
    
    	default:
    		fmt.Fprintf(f, "%%!%c(*types.Sym=%p)", verb, s)
    	}
    }
    
    func (s *Sym) String() string {
    	return sconv(s, 0, fmtGo)
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 15:41:17 UTC 2023
    - 15.7K bytes
    - Viewed (0)
  5. src/fmt/format.go

    		}
    	}
    	return b
    }
    
    // fmtS formats a string.
    func (f *fmt) fmtS(s string) {
    	s = f.truncateString(s)
    	f.padString(s)
    }
    
    // fmtBs formats the byte slice b as if it was formatted as string with fmtS.
    func (f *fmt) fmtBs(b []byte) {
    	b = f.truncate(b)
    	f.pad(b)
    }
    
    // fmtSbx formats a string or byte slice as a hexadecimal encoding of its bytes.
    func (f *fmt) fmtSbx(s string, b []byte, digits string) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:31:55 UTC 2024
    - 13.8K bytes
    - Viewed (0)
  6. src/fmt/print.go

    	case 'v':
    		if p.fmt.sharpV {
    			p.fmt.fmtQ(v)
    		} else {
    			p.fmt.fmtS(v)
    		}
    	case 's':
    		p.fmt.fmtS(v)
    	case 'x':
    		p.fmt.fmtSx(v, ldigits)
    	case 'X':
    		p.fmt.fmtSx(v, udigits)
    	case 'q':
    		p.fmt.fmtQ(v)
    	default:
    		p.badVerb(verb)
    	}
    }
    
    func (p *pp) fmtBytes(v []byte, verb rune, typeString string) {
    	switch verb {
    	case 'v', 'd':
    		if p.fmt.sharpV {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 21:22:43 UTC 2024
    - 31.8K bytes
    - Viewed (0)
  7. src/runtime/syscall_windows_test.go

    		// integer types, and uint8Pair_t.
    		cTypes[i] = t.In(i).Name() + "_t"
    		if t.In(i).Name() == "uint8Pair" {
    			cArgs[i] = fmt.Sprintf("(uint8Pair_t){%d,1}", i)
    		} else {
    			cArgs[i] = fmt.Sprintf("%d", i+1)
    		}
    	}
    	fmt.Fprintf(w, `
    typedef uintptr_t %s (*%s)(%s);
    uintptr_t %s(%s f) {
    	return f(%s);
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 31 16:31:35 UTC 2023
    - 32.5K bytes
    - Viewed (0)
  8. src/strconv/example_test.go

    	b16 = strconv.AppendUint(b16, 42, 16)
    	fmt.Println(string(b16))
    
    	// Output:
    	// uint (base 10):42
    	// uint (base 16):2a
    }
    
    func ExampleAtoi() {
    	v := "10"
    	if s, err := strconv.Atoi(v); err == nil {
    		fmt.Printf("%T, %v", s, s)
    	}
    
    	// Output:
    	// int, 10
    }
    
    func ExampleCanBackquote() {
    	fmt.Println(strconv.CanBackquote("Fran & Freddie's Diner ☺"))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 22:57:37 UTC 2023
    - 8.9K bytes
    - Viewed (0)
  9. src/slices/example_test.go

    	grow := slices.Grow(numbers, 2)
    	fmt.Println(cap(numbers))
    	fmt.Println(grow)
    	fmt.Println(len(grow))
    	fmt.Println(cap(grow))
    	// Output:
    	// 4
    	// [0 42 -10 8]
    	// 4
    	// 8
    }
    
    func ExampleClip() {
    	a := [...]int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
    	s := a[:4:10]
    	clip := slices.Clip(s)
    	fmt.Println(cap(s))
    	fmt.Println(clip)
    	fmt.Println(len(clip))
    	fmt.Println(cap(clip))
    	// Output:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 10 17:28:50 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  10. src/cmd/cgo/out.go

    			fmt.Fprint(fgo2, "\tif e != 0 {\n")
    			fmt.Fprint(fgo2, "\t\treturn ")
    			if !void {
    				fmt.Fprint(fgo2, "r, ")
    			}
    			fmt.Fprint(fgo2, "e\n")
    			fmt.Fprint(fgo2, "\t}\n")
    			fmt.Fprint(fgo2, "\treturn ")
    			if !void {
    				fmt.Fprint(fgo2, "r, ")
    			}
    			fmt.Fprint(fgo2, "nil\n")
    		} else if !void {
    			fmt.Fprint(fgo2, "\treturn r\n")
    		}
    
    		fmt.Fprint(fgo2, "}\n")
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 29 16:41:10 UTC 2024
    - 59.6K bytes
    - Viewed (0)
Back to top