creachadair / imath

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

Dynamically allocate the output buffer in the pi example #41

Closed motet-a closed 5 years ago

motet-a commented 5 years ago

It's not a very valuable contribution but I was a bit afraid yesterday when I discovered that the pi example yielded wrong results when the number of digits was higher than 4095.

In practice there was no buffer overflow. Everything is fine.

Fixes #40.

creachadair commented 5 years ago

I had some free time and wanted to resolve this, so I folded your changes into #42 along with my suggestions. Thank you for the fix!