Commit e4475d5
committed
Perform explicit casting for operations involving the number of indexed elements
Based on C99 conversion rules, int64_t (long long) is converted to
a float when another operand is a float. For long arrays, this is
problematic once the array length is greater than the maximum
safe single-precision floating-point integer (16777215). For example,
when calculating the arithmetic mean for long arrays, an odd length
may be converted to an even single-precision floating-point number,
thus leading to an inaccurate computation.
This commit works around conversion issues by converting operands
to double-precision before conversion to single-precision. This
ensures that we can support array lengths of up to 2**53 - 1,
matching the double-precision strided array variants.1 parent 7397f3e commit e4475d5
File tree
52 files changed
+130
-95
lines changed- lib/node_modules/@stdlib/stats/base
- dmeankbn2/src
- dmeankbn/src
- dmeanlipw/src
- dmeanli/src
- dmeanors/src
- dmeanpn/src
- dmeanpw/src
- dmeanwd/src
- dnanmeanors/src
- dnanmeanpn/src
- dnanmeanwd/src
- dnanvariancech/src
- dnanvariancetk/src
- dnanvariancewd/src
- dnanvarianceyc/src
- dsmeanors/src
- dsmeanpn/src
- dsmeanpw/src
- dsmeanwd/src
- dsnanmeanors/src
- dsnanmeanpn/src
- dsnanmeanwd/src
- dsvariancepn/src
- dvariancech/src
- dvariancepn/src
- dvariancetk/src
- dvariancewd/src
- dvarianceyc/src
- dvarmpn/src
- sdsmeanors/src
- sdsnanmeanors/src
- smeankbn2/src
- smeankbn/src
- smeanlipw
- lib
- src
- smeanli
- lib
- src
- smeanors/src
- smeanpn
- lib
- src
- smeanpw/src
- smeanwd/src
- snanmeanors/src
- snanmeanpn/src
- snanmeanwd/src
- svariancepn/src
- svariancetk/src
- svariancewd/src
- svarianceyc/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
52 files changed
+130
-95
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| 52 | + | |
| 53 | + | |
51 | 54 | | |
52 | 55 | | |
53 | | - | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
57 | | - | |
| 60 | + | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | | - | |
| 76 | + | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| |||
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
87 | | - | |
| 89 | + | |
88 | 90 | | |
0 commit comments