diff --git a/cnpy.h b/cnpy.h index 0d3bb4c..8171c8e 100644 --- a/cnpy.h +++ b/cnpy.h @@ -121,7 +121,7 @@ namespace cnpy { } std::vector header = create_npy_header(true_data_shape); - size_t nels = std::accumulate(shape.begin(),shape.end(),1,std::multiplies()); + size_t nels = std::accumulate(shape.begin(),shape.end(),static_cast(1),std::multiplies()); fseek(fp,0,SEEK_SET); fwrite(&header[0],sizeof(char),header.size(),fp); @@ -164,7 +164,7 @@ namespace cnpy { std::vector npy_header = create_npy_header(shape); - size_t nels = std::accumulate(shape.begin(),shape.end(),1,std::multiplies()); + size_t nels = std::accumulate(shape.begin(),shape.end(),static_cast(1),std::multiplies()); size_t nbytes = nels*sizeof(T) + npy_header.size(); //get the CRC of the data to be added