Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dtostrf() issue with value in range -1.0 < number_f < 0.0 #513

Closed
fpistm opened this issue May 2, 2019 · 0 comments
Closed

dtostrf() issue with value in range -1.0 < number_f < 0.0 #513

fpistm opened this issue May 2, 2019 · 0 comments
Assignees
Labels
bug 🐛 Something isn't working
Milestone

Comments

@fpistm
Copy link
Member

fpistm commented May 2, 2019

Describe the bug
Issue firstly reported here:
http://stm32duino.com/viewtopic.php?f=49&t=4650&p=54273#p54273

dtostrf() implementation is loosing a negative sign, if the input "double" number falls in the
range -1.0 < number_f < 0.0.
Likely to this part of the code in the dtostrf.c

if (negative) {
int_part = -int_part;
}

since integer part is "0", negation doesn't have any meaning.

To Reproduce
Use dtostrf with number in range -1.0 < number_f < 0.0

@fpistm fpistm added the bug 🐛 Something isn't working label May 2, 2019
@fpistm fpistm added this to the 1.6.0 milestone May 2, 2019
@fpistm fpistm self-assigned this May 2, 2019
@fpistm fpistm closed this as completed in b600b28 May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant