mirror of
https://github.com/google/brotli.git
synced 2026-07-08 17:56:58 +00:00
FastLog2 constant improvement #110
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mikir on GitHub (May 25, 2016).
In the header fast_log.h, the following constant is used:
static const double kLog2Inv = 1.4426950408889634f;Please, consider to replace this constant with exact formula not to loose accuracy:
static const double kLog2Inv = 1.0f / log(2);@eustas commented on GitHub (May 31, 2016):
Constant already has too high prescision.
When either of kLog2Inv values is printed out the result is 1.4426950_2162933349609_
@jyrkialakuijala commented on GitHub (May 31, 2016):
perhaps removing the f from the end would change something on another compiler?
@eustas commented on GitHub (Jun 16, 2016):
Fixed in v0.5
NB: most frequently used values are looked up in table. High precision for bigger values is not required.