DEV Community

Discussion on: Testing in Go: testing floating point numbers

Collapse
 
juliaferraioli profile image
julia ferraioli

That makes tons of sense to have an approved way to do it in Unity3D, considering how critical floating point precision is to physics simulations! (I'm looking at you, KSP.)

Yeah, there are likely far better comparison functions -- I'm still playing around with one that'll work for me. For this though, I was just demonstrating how to use the comparer option, and simple is always best for blog posts :-)

Thanks for sharing!

Collapse
 
bgadrian profile image
Adrian B.G.

Definitely, but your post made me curious how that function works, I used it but never saw its implementation.

Now I'm curious what is the most optimal way in Go to do it, to compare the first X decimals in a float, in Go, so your post worked! it made me a better dev.

Thread Thread
 
juliaferraioli profile image
julia ferraioli

๐ŸŽ‰