creachadair / imath

Arbitrary precision integer and rational arithmetic library
Other
131 stars 20 forks source link

Dynamically allocate the output buffer in the pi example #42

Closed creachadair closed 5 years ago

creachadair commented 5 years ago

Originally proposed by @motet-a in #41, with some additional modifications.

This fixes the case where the global buffer did not have enough space to hold a result longer than 4K, giving rise to truncated and/or incorrect results. Dynamically allocate the buffer instead.

Fixes #40.