Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/stdlib_io_npy_load.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ contains

if (major > 1) then
header_len = ichar(buf(1)) &
& + ichar(buf(2)) * 2**8 &
& + ichar(buf(3)) * 2**16 &
& + ichar(buf(4)) * 2**32
& + ichar(buf(2)) * 256**1 &
& + ichar(buf(3)) * 256**2 &
& + ichar(buf(4)) * 256**3
else
header_len = ichar(buf(1)) &
& + ichar(buf(2)) * 2**8
& + ichar(buf(2)) * 256**1
end if
allocate(character(header_len) :: dict, stat=stat)
if (stat /= 0) return
Expand Down
8 changes: 4 additions & 4 deletions src/stdlib_io_npy_save.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ contains
!> String of bytes
character(len=4) :: str

str = achar(mod(val, 2**8)) // &
& achar(mod(val, 2**16) / 2**8) // &
& achar(mod(val, 2**32) / 2**16) // &
& achar(val / 2**32)
str = achar(mod(val, 256**1)) // &
& achar(mod(val, 256**2) / 256**1) // &
& achar(mod(val, 256**3) / 256**2) // &
& achar(val / 256**3)
end function to_bytes_i4


Expand Down