Skip to content

Commit bc73b5e

Browse files
committed
Fix cin on large floats.
1 parent 9355d8d commit bc73b5e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ArduinoSTL
2-
version=0.1.5
2+
version=0.1.6
33
author=Mike Matera <matera@lifealgorithmic.com>
44
maintainer=Mike Matera <matera@lifealgorithmic.com>
55
sentence=A port of uClibc++ packaged as an Arduino library.

src/istream_helpers

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,9 @@ namespace std{
324324
}
325325
unsigned int dec = temp.find('.', 0);
326326
if (dec == string::npos) {
327-
var = atoi(temp.c_str());
327+
var = atol(temp.c_str());
328328
}else{
329-
var = atoi(temp.substr(0,dec).c_str());
329+
var = atol(temp.substr(0,dec).c_str());
330330
var += ((double) atoi(temp.substr(dec+1).c_str())) / pow(10.0,temp.size()-dec-1);
331331
}
332332
if (isneg)
@@ -351,9 +351,9 @@ namespace std{
351351
}
352352
unsigned int dec = temp.find('.', 0);
353353
if (dec == string::npos) {
354-
var = atoi(temp.c_str());
354+
var = atol(temp.c_str());
355355
}else{
356-
var = atoi(temp.substr(0,dec).c_str());
356+
var = atol(temp.substr(0,dec).c_str());
357357
var += ((double) atoi(temp.substr(dec+1).c_str())) / pow(10.0,temp.size()-dec-1);
358358
}
359359
if (isneg)

0 commit comments

Comments
 (0)