Skip to content

Commit

Permalink
fixed filesize error in fromfile in support of Issue #219
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilger26 committed Jan 2, 2025
1 parent 684dcd7 commit caa26aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/markdown/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* added `putAlongAxis()` for **Issue #217** <https://numpy.org/doc/stable/reference/generated/numpy.put_along_axis.html>
* fixed random seeding for **Issue #218**
* fixed error in `fromfile()` that limited filesize to 4GB for **Issue #219**

## Version 2.12.1

Expand Down
4 changes: 2 additions & 2 deletions include/NumCpp/Functions/fromfile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace nc
}

file.seekg(0, std::ifstream::end);
const uint32 fileSize = static_cast<uint32>(file.tellg());
const auto fileSize = static_cast<uint64>(file.tellg());
file.seekg(0, std::ifstream::beg);

std::vector<char> fileBuffer;
Expand All @@ -75,7 +75,7 @@ namespace nc

if (file.bad() || file.fail())
{
THROW_INVALID_ARGUMENT_ERROR("error occured while reading the file");
THROW_INVALID_ARGUMENT_ERROR("error occured while reading the file\n");
}

file.close();
Expand Down

0 comments on commit caa26aa

Please sign in to comment.