MCPcopy
hub / github.com/minio/minio-go / ExampleSet_float64Set

Function ExampleSet_float64Set

pkg/set/example_test.go:91–102  ·  view source on GitHub ↗

ExampleSet_float64Set demonstrates using Set with floating point numbers

()

Source from the content-addressed store, hash-verified

89
90// ExampleSet_float64Set demonstrates using Set with floating point numbers
91func ExampleSet_float64Set() {
92 temps := set.Create(98.6, 100.4, 99.1, 98.6)
93
94 fmt.Println("Unique temperatures:", len(temps))
95 fmt.Println("Has 100.4:", temps.Contains(100.4))
96 fmt.Println("Temperatures:", set.ToSliceOrdered(temps))
97
98 // Output:
99 // Unique temperatures: 3
100 // Has 100.4: true
101 // Temperatures: [98.6 99.1 100.4]
102}
103
104// ExampleSet_ApplyFunc demonstrates transforming set elements
105func ExampleSet_ApplyFunc() {

Callers

nothing calls this directly

Calls 3

CreateFunction · 0.92
ToSliceOrderedFunction · 0.92
ContainsMethod · 0.45

Tested by

no test coverage detected