Skip to content

Commit

Permalink
Fix cin on large floats.
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-matera committed Oct 5, 2016
1 parent 9355d8d commit bc73b5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ArduinoSTL
version=0.1.5
version=0.1.6
author=Mike Matera <matera@lifealgorithmic.com>
maintainer=Mike Matera <matera@lifealgorithmic.com>
sentence=A port of uClibc++ packaged as an Arduino library.
Expand Down
8 changes: 4 additions & 4 deletions src/istream_helpers
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,9 @@ namespace std{
}
unsigned int dec = temp.find('.', 0);
if (dec == string::npos) {
var = atoi(temp.c_str());
var = atol(temp.c_str());
}else{
var = atoi(temp.substr(0,dec).c_str());
var = atol(temp.substr(0,dec).c_str());
var += ((double) atoi(temp.substr(dec+1).c_str())) / pow(10.0,temp.size()-dec-1);
}
if (isneg)
Expand All @@ -351,9 +351,9 @@ namespace std{
}
unsigned int dec = temp.find('.', 0);
if (dec == string::npos) {
var = atoi(temp.c_str());
var = atol(temp.c_str());
}else{
var = atoi(temp.substr(0,dec).c_str());
var = atol(temp.substr(0,dec).c_str());
var += ((double) atoi(temp.substr(dec+1).c_str())) / pow(10.0,temp.size()-dec-1);
}
if (isneg)
Expand Down

0 comments on commit bc73b5e

Please sign in to comment.