MCPcopy
hub / github.com/valyala/quicktemplate / F

Method F

writer.go:140–150  ·  view source on GitHub ↗

F writes f to w.

(f float64)

Source from the content-addressed store, hash-verified

138
139// F writes f to w.
140func (w *QWriter) F(f float64) {
141 n := int(f)
142 if float64(n) == f {
143 // Fast path - just int.
144 w.D(n)
145 return
146 }
147
148 // Slow path.
149 w.FPrec(f, -1)
150}
151
152// FPrec writes f to w using the given floating point precision.
153func (w *QWriter) FPrec(f float64, prec int) {

Callers 5

BenchmarkQWriterFfloatFunction · 0.95
BenchmarkQWriterFintFunction · 0.95
TestWriterFunction · 0.80
TestQWriterFFunction · 0.80
StreamIntegrationFunction · 0.80

Calls 2

DMethod · 0.95
FPrecMethod · 0.95

Tested by 4

BenchmarkQWriterFfloatFunction · 0.76
BenchmarkQWriterFintFunction · 0.76
TestWriterFunction · 0.64
TestQWriterFFunction · 0.64