path: root/support
diff options
mode: <>2019-12-05 06:37:39 +0000 <>2019-12-05 06:37:39 +0000
commit35ac808f091891eea09ceb058d6d88ccde4feffb (patch)
tree2a76598978046df7d6cd00fb13acf7a17570e351 /support
parent6d707df71c0fe11da7dd53bf36eb3d3fadb8ec9b (diff)
[PATCH v2] Force correct sign for intermediate steps of bigmul
Since y1 is usually smaller than y0, the sign of (x0 - x1) * (y1 - y0) is usually the same as that of (x0 - x1). This isn't always the case, though, especially if y is 2^Large * small. Also, the result of umul should be trimmed, so that we can trust that z0, z1 are trimmed in kmul. Otherwise, if their signs are different, bigadd(z1, z0) may become confused about which has greater magnitude and perform an incorrect subtraction. Since the result of kmul comes from bigadd(), which trims already, we need only trim the result of smallmul to ensure that umul's result is trimmed.
Diffstat (limited to 'support')
0 files changed, 0 insertions, 0 deletions