Skip to content

Commit e4b5fbb

Browse files
authored
Merge pull request #230 from kojix2/dev
Integrate pull requests and verify that all tests pass
2 parents a205587 + 93d7ed0 commit e4b5fbb

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ on: [push, pull_request]
55
jobs:
66
MRI:
77
name: ${{ matrix.os }} ruby-${{ matrix.ruby }}
8-
runs-on: ${{ matrix.os }}
8+
runs-on: ${{ matrix.os }}-latest
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
os: [ubuntu-latest, macos-11, windows-2022]
13-
ruby: [ '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3', head]
14-
include:
15-
- { os: windows-2022 , ruby: mswin }
12+
os: ['ubuntu', 'macos', 'windows']
13+
ruby: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3', '3.4', head]
1614
steps:
1715
- uses: actions/checkout@v4
1816
- name: Set up Ruby ${{ matrix.ruby }}
@@ -59,7 +57,7 @@ jobs:
5957
sudo apt-get -y install podman
6058
podman pull fedora:rawhide
6159
- name: Get source
62-
uses: actions/checkout@v3
60+
uses: actions/checkout@v4
6361
with:
6462
path: 'numo-narray'
6563
- name: Create container and run tests
@@ -75,6 +73,7 @@ jobs:
7573
echo 'RUN gem build numo-narray.gemspec'
7674
echo 'RUN gem install numo-narray-*.gem'
7775
echo 'RUN bundle install'
76+
echo 'RUN bundle exec rake compile'
7877
echo 'RUN bundle exec rake test'
7978
} > podmanfile
8079
podman build --tag fedora_test -f ./podmanfile

ext/numo/narray/ndloop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ typedef struct NA_MD_LOOP {
5656
VALUE reduce;
5757
VALUE loop_opt;
5858
ndfunc_t *ndfunc;
59-
void (*loop_func)();
59+
void (*loop_func)(ndfunc_t *, struct NA_MD_LOOP *);
6060
} na_md_loop_t;
6161

6262
#define LARG(lp,iarg) ((lp)->user.args[iarg])

ext/numo/narray/numo/types/xint_macro.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33

44
#define m_extract(x) m_data_to_num(*(dtype*)(x))
55

6-
#define m_from_double(x) (x)
7-
#define m_from_real(x) (x)
6+
/* Handle negative values consistently across platforms for unsigned integer types */
7+
#define m_from_double(x) ((x) < 0 ? (dtype)((long long)(x)) : (dtype)(x))
8+
#define m_from_real(x) ((x) < 0 ? (dtype)((long long)(x)) : (dtype)(x))
89
#define m_from_sint(x) (x)
910
#define m_from_int32(x) (x)
1011
#define m_from_int64(x) (x)

test/narray_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ class NArrayTest < Test::Unit::TestCase
142142
assert { a.sum == 29 }
143143
if float_types.include?(dtype)
144144
assert { a.mean == 29.0/6 }
145-
assert { a.var == 13.766666666666669 }
146-
assert { a.stddev == 3.710345895825168 }
147-
assert { a.rms == 5.901977069875258 }
145+
assert_in_delta(a.var, 13.766666666666669, 1e-14)
146+
assert_in_delta(a.stddev, 3.710345895825168, 1e-14)
147+
assert_in_delta(a.rms, 5.901977069875258, 1e-14)
148148
end
149149
assert { a.dup.fill(12) == [12]*6 }
150150
assert { (a + 1) == [2,3,4,6,8,12] }

0 commit comments

Comments
 (0)