Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for float32strings (0.16 sec)

  1. src/strconv/atof_test.go

    	}
    }
    
    func BenchmarkAtof32Random(b *testing.B) {
    	n := uint32(997)
    	var float32strings [4096]string
    	for i := range float32strings {
    		n = (99991*n + 42) % (0xff << 23)
    		float32strings[i] = FormatFloat(float64(math.Float32frombits(n)), 'g', -1, 32)
    	}
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		ParseFloat(float32strings[i%4096], 32)
    	}
    }
    
    func BenchmarkAtof32RandomLong(b *testing.B) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 26 16:24:57 UTC 2022
    - 23.6K bytes
    - Viewed (0)
Back to top