Skip to content

Commit 251b4ce

Browse files
authored
Silence double to float truncation VS warnings
When loading float values, Visual Studio generates a warning : `Q:\Code\csv-reader\csv\csv.h(1061): warning C4305: '=': truncation from 'double' to 'float'`. This is averted by explicitly typing the literal values.
1 parent 78f4132 commit 251b4ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

csv.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,10 +1058,10 @@ namespace io{
10581058
if(e != 0){
10591059
T base;
10601060
if(e < 0){
1061-
base = 0.1;
1061+
base = T(0.1);
10621062
e = -e;
10631063
}else{
1064-
base = 10;
1064+
base = T(10);
10651065
}
10661066

10671067
while(e != 1){

0 commit comments

Comments
 (0)