cmpute/dashu

infinite loop in `powf` and `ln`

Closed this issue ยท 3 comments

Thanks for making this library! I've discovered some bugs while experimenting with taking it on as a dependency for OpenDP (https://github.com/opendp/opendp).

I'm using dashu 0.4.

powf infinite loop

FBig::<Up>::from(2).powf(&FBig::from(2));

Only gets stuck when the rounding is Up. Gets stuck for any choice of nontrivial power.

ln infinite loop

FBig::<Up>::from(2).ln()

Only gets stuck when the rounding is Up.

powf panic

The following expression causes dashu to panic:

FBig::<Up>::from(0).powf(&FBig::from(2));

This panic happens on any of the rounding modes I've tested.

Thanks!

Thanks for reporting this, will take a look.

The key function I need at this point is ln. From debugging the code it gets stuck in the loop inside fn iacoth: next is always a factor of 10 larger than sum.

This should be fixed now. Please try the new published version 0.4.1 and feel free to reopen when the bug persists.