Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.

Implement fuzzing of complex types#37

Merged
lavalamp merged 1 commit into
google:masterfrom
punkeel:fuzz-complex
Feb 3, 2020
Merged

Implement fuzzing of complex types#37
lavalamp merged 1 commit into
google:masterfrom
punkeel:fuzz-complex

Conversation

@punkeel

@punkeel punkeel commented Feb 2, 2020

Copy link
Copy Markdown
Contributor

From builtin.go:
The complex built-in function constructs a complex value from two floating-point
values. The real and imaginary parts must be of the same size, either float32 or
float64 (or assignable to them), and the return value will be the corresponding
complex type (complex64 for float32, complex128 for float64).

From builtin.go:
The complex built-in function constructs a complex value from two floating-point
values. The real and imaginary parts must be of the same size, either float32 or
float64 (or assignable to them), and the return value will be the corresponding
complex type (complex64 for float32, complex128 for float64).
Comment thread fuzz.go
},
reflect.Complex64: func(v reflect.Value, r *rand.Rand) {
panic("unimplemented")
v.SetComplex(complex128(complex(r.Float32(), r.Float32())))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to look it up for myself, but the "extra" cast you have here is 100% necessary, so... ✔️

@lavalamp

lavalamp commented Feb 3, 2020

Copy link
Copy Markdown
Contributor

LGTM, thanks

@lavalamp lavalamp merged commit 2257016 into google:master Feb 3, 2020
@punkeel

punkeel commented Feb 3, 2020

Copy link
Copy Markdown
Contributor Author

Thanks!

@punkeel punkeel deleted the fuzz-complex branch February 3, 2020 23:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants