]> Cypherpunks repositories - gostls13.git/commit
image/jpeg: initialize dct_test constants at compile time
authorNigel Tao <nigeltao@golang.org>
Sun, 3 Nov 2024 12:21:45 +0000 (23:21 +1100)
committerNigel Tao <nigeltao@golang.org>
Wed, 6 Nov 2024 21:57:39 +0000 (21:57 +0000)
commit9088883cf4a5181cf796c968bbce5a5bc3edc7ab
tree1791f8433816261b344a2225284c0ab150b7c9b1
parenteb29beb0ad83353097786cda793af8dea0b05b27
image/jpeg: initialize dct_test constants at compile time

Doing so is slightly more accurate than calculating at run time (because
of float64 rounding errors): https://go.dev/play/p/hrOzHDLjd5K

Having these more accurate values isn't necessary for tests to pass, but
it's helpful if doing printf-debugging or stepping through the code.

Change-Id: I07a65678936e4db05b11f9d8d952b32b2acd51a8
Reviewed-on: https://go-review.googlesource.com/c/go/+/624716
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Nigel Tao <nigeltao@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/image/jpeg/dct_test.go