commonlib: Add support for rational number approximation
This patch adds a function to calculate best rational approximation for a given fraction and unit tests for it. Change-Id: I2272d9bb31cde54e65721f95662b80754eee50c2 Signed-off-by: Vinod Polimera <quic_vpolimer@quicinc.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/66010 Reviewed-by: Yu-Ping Wu <yupingso@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
committed by
Shelley Chen
parent
65377eba7f
commit
7528311929
@@ -2,7 +2,11 @@
|
||||
|
||||
subdirs-y += bsd
|
||||
|
||||
tests-y += rational-test
|
||||
tests-y += region-test
|
||||
|
||||
rational-test-srcs += tests/commonlib/rational-test.c
|
||||
rational-test-srcs += src/commonlib/rational.c
|
||||
|
||||
region-test-srcs += tests/commonlib/region-test.c
|
||||
region-test-srcs += src/commonlib/region.c
|
||||
|
Reference in New Issue
Block a user