Commit 1ac59e979838967958a42c43bab6543c7dbb93e4

Authored by knodlseder
1 parent 56d87b7a

remplace atoi by int(atof) since atoi does not convert exponential representation correctly

Showing 1 changed file with 2 additions and 2 deletions
src/fits/GFitsTableStrCol.cpp
... ... @@ -318,7 +318,7 @@ int GFitsTableStrCol::integer(const int& row, const int& inx)
318 318 if (row < 0 || row >= m_length)
319 319 throw GException::out_of_range(G_INTEGER, row, 0, m_length-1);
320 320  
321   - // Check col value
  321 + // Check inx value
322 322 if (inx < 0 || inx >= m_number)
323 323 throw GException::out_of_range(G_INTEGER, inx, 0, m_number-1);
324 324  
... ... @@ -326,7 +326,7 @@ int GFitsTableStrCol::integer(const int&amp; row, const int&amp; inx)
326 326 int offset = row * m_number + inx;
327 327  
328 328 // Assign C string to int
329   - int value = atoi(m_data[offset].c_str());
  329 + int value = int(atof(m_data[offset].c_str()));
330 330  
331 331 // Return value
332 332 return value;
... ...