在 python 中使用 affine.Affine 中的极小数字

Use extremely small number in affine.Affine in python

Affine.scale中的小数始终为零

例如,

from affine import Affine

# This line will show
#| 0.00, 0.00, 0.00|
#| 0.00, 0.00, 0.00|
#| 0.00, 0.00, 1.00|
print(Affine.scale(1/(2**19)))

但是,我需要 1.9073486328125e-06 而不是 0。

我该如何解决这个问题?

(我用的affine版本是2.3.0。)

打印仿射变换矩阵将使其打印四舍五入的数字。

我们应该使用索引来获取存储在 metirx 中的确切数字。

print(Affine.scale(1/(2**19))[0])
# got: 1.9073486328125e-06