| 1 |
package pkg |
| 2 |
|
| 3 |
const x = 0.0 |
| 4 |
|
| 5 |
func fn() { |
| 6 |
_ = math.Copysign(0, -1) //@ diag(`in Go, the floating-point literal '-0.0' is the same as '0.0', it does not produce a negative zero`) |
| 7 |
_ = float32(math.Copysign(0, -1)) //@ diag(`in Go, the floating-point literal '-0.0' is the same as '0.0', it does not produce a negative zero`) |
| 8 |
_ = float64(math.Copysign(0, -1)) //@ diag(`in Go, the floating-point literal '-0.0' is the same as '0.0', it does not produce a negative zero`) |
| 9 |
_ = float32(math.Copysign(0, -1)) //@ diag(`in Go, the floating-point expression '-float32(0)' is the same as 'float32(0)', it does not produce a negative zero`) |
| 10 |
_ = math.Copysign(0, -1) //@ diag(`in Go, the floating-point expression '-float64(0)' is the same as 'float64(0)', it does not produce a negative zero`) |
| 11 |
_ = float32(math.Copysign(0, -1)) //@ diag(`in Go, the floating-point expression '-float32(0.0)' is the same as 'float32(0.0)', it does not produce a negative zero`) |
| 12 |
_ = math.Copysign(0, -1) //@ diag(`in Go, the floating-point expression '-float64(0.0)' is the same as 'float64(0.0)', it does not produce a negative zero`) |
| 13 |
|
| 14 |
// intentionally not flagged |
| 15 |
_ = -x |
| 16 |
} |