vector: fix tests on wasm

On wasm, calculations on float32 values are done with 64 bit precision.
This is allowed by the Go specification, only explicit conversions to
float32 have to round to 32 bit precision. The difference caused by the
additional precision accumulates over several calculations and causes
the test results to not fully match the expectations. Account for this
by giving a 0.1% tolerance.

Fixes golang/go#31281.

Change-Id: I843788f912015600a18ff3d5cf5520c60403b534
Reviewed-on: https://go-review.googlesource.com/c/image/+/171257
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
1 file changed
tree: 246d7d40cb6b839b9ef560bb7b0ee2de4e0b1fee
  1. .gitattributes
  2. .gitignore
  3. AUTHORS
  4. CONTRIBUTING.md
  5. CONTRIBUTORS
  6. LICENSE
  7. PATENTS
  8. README.md
  9. bmp/
  10. cmd/
  11. codereview.cfg
  12. colornames/
  13. draw/
  14. example/
  15. font/
  16. go.mod
  17. go.sum
  18. math/
  19. riff/
  20. testdata/
  21. tiff/
  22. vector/
  23. vp8/
  24. vp8l/
  25. webp/
README.md

Go Images

This repository holds supplementary Go image libraries.

Download/Install

The easiest way to install is to run go get -u golang.org/x/image/.... You can also manually git clone the repository to $GOPATH/src/golang.org/x/image.

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.

The main issue tracker for the image repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/image:” in the subject line, so it is easy to find.