mirror of https://github.com/CGAL/cgal
fix reading of doubles. There may be a + after the e
This commit is contained in:
parent
4db540c6c8
commit
b1c417e7b7
|
|
@ -132,7 +132,7 @@ public:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
c = static_cast<char_type>(i);
|
c = static_cast<char_type>(i);
|
||||||
if(std::isdigit(c) || (c =='.') || (c =='E') || (c =='e') || (c =='-')){
|
if(std::isdigit(c) || (c =='.') || (c =='E') || (c =='e') || (c =='+') || (c =='-')){
|
||||||
buffer += c;
|
buffer += c;
|
||||||
}else{
|
}else{
|
||||||
is.unget();
|
is.unget();
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
+1.2e+3 45 12
|
||||||
|
+1.2e03 45 12
|
||||||
|
+1.2e003 45 12
|
||||||
|
-1.2e03 45 12
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <CGAL/Simple_cartesian.h>
|
||||||
|
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
std::ifstream in("data/double.txt");
|
||||||
|
CGAL::Simple_cartesian<double>::Point_3 p;
|
||||||
|
while(in >> p){
|
||||||
|
std::cout << p << std::endl;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue