ExampleSet_float64Set demonstrates using Set with floating point numbers
()
| 89 | |
| 90 | // ExampleSet_float64Set demonstrates using Set with floating point numbers |
| 91 | func 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 |
| 105 | func ExampleSet_ApplyFunc() { |
nothing calls this directly
no test coverage detected