Nasty bug in modp_dtoa #144

Closed
opened 2026-01-29 20:38:26 +00:00 by claunia · 2 comments
Owner

Originally created by @jeroen on GitHub (Sep 21, 2016).

I got bitten by a this long standing bug in modp_dtoa{,2,3}: https://github.com/client9/stringencoders/issues/40. I was able to reproduce it with brotli as well.

The following values should rond to 1.0 but instead return 0.1

modp_dtoa(0.95, str, 1); 
modp_dtoa(0.9999995, str, 6); 

Unfortunately upstream does not seem to be maintained anymore.

Originally created by @jeroen on GitHub (Sep 21, 2016). I got bitten by a this long standing bug in `modp_dtoa{,2,3}`: https://github.com/client9/stringencoders/issues/40. I was able to reproduce it with brotli as well. The following values should rond to `1.0` but instead return `0.1` ``` c modp_dtoa(0.95, str, 1); modp_dtoa(0.9999995, str, 6); ``` Unfortunately upstream does not seem to be maintained anymore.
Author
Owner

@eustas commented on GitHub (Sep 21, 2016):

Could you point where it is used in brotli, please.
The only double-to-string conversion occurs in "bro" tool...

@eustas commented on GitHub (Sep 21, 2016): Could you point where it is used in brotli, please. The only double-to-string conversion occurs in "bro" tool...
Author
Owner

@jeroen commented on GitHub (Sep 21, 2016):

Apologies, I seem to have mixed up with another repository.

@jeroen commented on GitHub (Sep 21, 2016): Apologies, I seem to have mixed up with another repository.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#144