Skip to content

Commit 3da37a7

Browse files
committed
Merge branch 'master' of jsoftware.com:jsource
2 parents ec1c00a + 023a4a7 commit 3da37a7

File tree

12 files changed

+159
-148
lines changed

12 files changed

+159
-148
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ J is easy to install, has a small footprint, and has direct access to tutorials
77

88
The latest release is J9.4 with several new language features and performance improvements, available from March 2023. See [J9.4 Release Notes](https://code.jsoftware.com/wiki/System/ReleaseNotes/J9.4).
99

10-
<!-- A [J904 beta](https://code.jsoftware.com/wiki/System/ReleaseNotes/J904) is available from April 2022. -->
10+
<!-- A [J904 beta](https://code.jsoftware.com/wiki/System/ReleaseNotes/J904) is available from April 2022. -->
1111

1212
Documentation can be found in the [J wiki](https://code.jsoftware.com/wiki).
1313

jsrc/xcrc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ DF1(jttobase64){
9999
// Allocate result
100100
A z; GATV0(z,LIT,zn<<2,1); UI4 *zv=UI4AV(z); // result block, pointer into it
101101
C *wv=CAV(w); // input pointer
102-
// #if 0 // superseded by library
103-
#if defined(__wasm__) // superseded by library
102+
// #if defined(__wasm__) // superseded by library
103+
#if 0 // superseded by library
104104
// Handle each 3-byte group, producing a 4-byte result. We load 3 bytes at a time, so we may read into the padding area, but never
105105
// past the valid allocation. We don't worry about load alignment
106106
for(;n3;--n3){
@@ -164,8 +164,8 @@ DF1(jtfrombase64){
164164
A z; GATV0(z,LIT,(wn>>2)*3 + (((wn&3)+1)>>1),1); // 3 bytes per full set, plus 0, 1, or 2
165165
// process the input in full 4-byte groups. We may overread the input AND overwrite the result, but we will always stay in the padding area,
166166
// which is OK because we allocated the result here
167-
// #if 0 // superseded by library
168-
#if defined(__wasm__) // superseded by library
167+
// #if defined(__wasm__) // superseded by library
168+
#if 0 // superseded by library
169169
UI4 *wv4=UI4AV(w); C *zv=CAV(z); // write result as bytes, to avoid requiring heroic action in the write combiners
170170
for(wn-=3;wn>0;wn-=4){ // for each block of 4, not counting an incomplete last one
171171
// translate the UTF8 via table lookup. We could avoid the table reads if we didn't feel the need to validate the input

make2/build_jamalgam.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,12 +656,13 @@ case $jplatform64 in
656656

657657
wasm/j32) # webassembly
658658
TARGET=jamalgam.js
659-
CFLAGS="$common -m32 -D IMPORTGMPLIB -D CSTACKSIZE=65536 -D CSTACKRESERVE=10000 -D TESTS "
659+
# 948KB stack on v8
660+
CFLAGS="$common -m32 -D IMPORTGMPLIB -D CSTACKSIZE=1007616 -D CSTACKRESERVE=100000 -D TESTS "
660661
# these flags do not work on iOS
661662
# -msse2 -msimd128
662663
# EMSCRIPTEN_KEEPALIVE instead of -s LINKABLE=1 -s EXPORT_ALL=1
663664
LDFLAGS=" ../../../../mpir/linux/wasm32/libgmp.a \
664-
-s WASM=1 -s ASSERTIONS=1 -s INITIAL_MEMORY=220MB -s TOTAL_MEMORY=600MB -s ALLOW_MEMORY_GROWTH=1 \
665+
-s WASM=1 -s ASSERTIONS=1 -s INITIAL_MEMORY=220MB -s TOTAL_MEMORY=600MB -s ALLOW_MEMORY_GROWTH=1 -s STACK_SIZE=984KB \
665666
-s BINARYEN_EXTRA_PASSES="--pass-arg=max-func-params@80" -s EMULATE_FUNCTION_POINTER_CASTS=1 -s NO_EXIT_RUNTIME=1 \
666667
-s EXPORTED_FUNCTIONS='[\"_main\"]' \
667668
-s EXPORTED_RUNTIME_METHODS='[\"cwrap\",\"ccall\", \"UTF8ToString\", \"lengthBytesUTF8\", \"stringToUTF8\"]' \

make2/build_libj.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,8 @@ case $jplatform64 in
647647

648648
wasm/j32) # webassembly
649649
TARGET=libj.a
650-
CFLAGS="$common -m32 -D IMPORTGMPLIB -D CSTACKSIZE=65536 -D CSTACKRESERVE=10000 "
650+
# 948KB stack on v8
651+
CFLAGS="$common -m32 -D IMPORTGMPLIB -D CSTACKSIZE=1007616 -D CSTACKRESERVE=100000 "
651652
# these flags do not work on iOS
652653
# -msse2 -msimd128
653654
# EMSCRIPTEN_KEEPALIVE instead of -s LINKABLE=1 -s EXPORT_ALL=1

test/g420.ijs

Lines changed: 12 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ NB. test failed on small ct
77
ct =: 9!:18''
88
9!:19[2^_40
99

10-
'NaN error' -: +/ etx _ __ NB. smoke test
11-
1210
insert =: 1 : '{. ` ({. u $:@}.) @. (1&<@#)' NB. one or more items
1311

1412
(= /t) -: = insert t=: 20 ?@$ 2
@@ -697,17 +695,6 @@ iota =: > @ (+/&.>/) @ (i.&.> *&.> */\.@}.@(,&1))
697695
(($x),$y) -: $(x=:i.0 ) ^ / y=:i.0
698696
(($x),$y) -: $(x=:i.0 ) ^!.0/ y=:i.0
699697

700-
NB. f/ NaN --------------------------------------------------------------
701-
702-
'NaN error' -: +/ etx (_ __ ([)`(2 ? #@])`]} ]) (2 + ? 100) ?@$ 0
703-
'NaN error' -: +/ etx ((,._ __) ([)`([: < 2 1 <@? $@])`]} ]) (2 + ? 50 50) ?@$ 0
704-
'NaN error' -: +/"2 etx ((,._ __) ([)`([: < 1 2 1 <@? $@])`]} ]) (2 + ? 4 50 50) ?@$ 0
705-
706-
'NaN error' -: -/ etx (_ __ ([)`(2 * 2 ? <.@:-:@:#@])`]} ]) (4 + ? 100) ?@$ 0
707-
'NaN error' -: -/ etx ((,._ __) ([)`([: < 2 *&.> 2 1 <@? <.@:-:@:$@])`]} ]) (4 + ? 50 50) ?@$ 0
708-
'NaN error' -: -/"2 etx ((,._ __) ([)`([: < 2 *&.> 1 2 1 <@? <.@:-:@:$@])`]} ]) (4 + ? 4 50 50) ?@$ 0
709-
710-
711698
NB. +/ Magic Cubes -----------------------------------------------------
712699

713700
NB. by Professor James G. Mauldon via Ken Iverson
@@ -729,112 +716,18 @@ test 11
729716
test 23
730717
test 29
731718

732-
NB. Fold F. F.. F.: F: F:. F:: ------------------------------------------------------------------
733-
NB. monad
734-
10 -: ] F.. + i. 5
735-
10 -: ] F.: + i. 5
736-
2 -: ] F.. - i. 5
737-
2 -: ] F.: - i. 5
738-
1 3 6 10 -: ] F:. + i. 5
739-
7 9 10 10 -: ] F:: + i. 5
740-
1 1 2 2 -: ] F:. - i. 5
741-
_1 3 _2 2 -: ] F:: - i. 5
742-
NB. dyad
743-
110 -: 100 ] F.. + i. 5
744-
110 -: 100 ] F.: + i. 5
745-
_98 -: 100 ] F.. - i. 5
746-
_98 -: 100 ] F.: - i. 5
747-
100 101 103 106 110 -: 100 ] F:. + i. 5
748-
104 107 109 110 110 -: 100 ] F:: + i. 5
749-
_100 101 _99 102 _98 -: 100 ] F:. - i. 5
750-
_96 99 _97 98 _98 -: 100 ] F:: - i. 5
751-
NB. Using v
752-
315 339 381 441 519 -: (6;100 101 102) (+/@:;) F:. ((, 0&{::) ; (+ 1&{::)) i. 5 3
753-
387 447 489 513 519 -: (6;100 101 102) (+/@:;) F:: ((, 0&{::) ; (+ 1&{::)) i. 5 3
754-
NB. early termination
755-
9 21 42 -: (6;100 101 102) (+/@:(0&{::) [ _2 Z: 9 e. 0&{::) F:. ((, 0&{::) ; (+ 1&{::)) i. 5 3
756-
9 21 72 111 -: (6;100 101 102) (+/@:(0&{::) [ _1 Z: 42 = [: +/ 0&{::) F:. ((, 0&{::) ; (+ 1&{::)) i. 5 3
757-
9 21 72 111 -: (6;100 101 102) (+/@:(0&{::) [ 0 Z: 42 = [: +/ 0&{::) F:. ((, 0&{::) ; (+ 1&{::)) i. 5 3
758-
9 21 42 -: (6;100 101 102) (+/@:(0&{::) [ 1 Z: 42 = [: +/ 0&{::) F:. ((, 0&{::) ; (+ 1&{::)) i. 5 3
759-
NB. early termination in u
760-
9 21 42 -: (6;100 101 102) (+/@:(0&{::)) F:. (([ _2 Z: 9 e. 0&{::)@:((, 0&{::) ; (+ 1&{::))) i. 5 3
761-
9 21 51 90 -: (6;100 101 102) (+/@:(0&{::)) F:. (([ _1 Z: 42 = [: +/ 0&{::)@((, 0&{::) ; (+ 1&{::))) i. 5 3
762-
9 21 72 111 -: (6;100 101 102) (+/@:(0&{::)) F:. (([ 0 Z: 42 = [: +/ 0&{::)@((, 0&{::) ; (+ 1&{::))) i. 5 3
763-
9 21 42 -: (6;100 101 102) (+/@:(0&{::)) F:. (([ 1 Z: 42 = [: +/ 0&{::)@((, 0&{::) ; (+ 1&{::))) i. 5 3
764-
NB. check uncaught throw
765-
dbr 1
766-
9 21 42 -: (6;100 101 102) (+/@:(0&{::)) F:. (([ _2 Z: 9 e. 0&{::)@:((, 0&{::) ; (+ 1&{::))) i. 5 3
767-
9 21 51 90 -: (6;100 101 102) (+/@:(0&{::)) F:. (([ _1 Z: 42 = [: +/ 0&{::)@((, 0&{::) ; (+ 1&{::))) i. 5 3
768-
9 21 72 111 -: (6;100 101 102) (+/@:(0&{::)) F:. (([ 0 Z: 42 = [: +/ 0&{::)@((, 0&{::) ; (+ 1&{::))) i. 5 3
769-
9 21 42 -: (6;100 101 102) (+/@:(0&{::)) F:. (([ 1 Z: 42 = [: +/ 0&{::)@((, 0&{::) ; (+ 1&{::))) i. 5 3
770-
dbr Debug
771-
NB. empty results
772-
'domain error' -: (6;100 101 102) (+/@:(0&{::) [ _2 Z: 6 e. 0&{::) F:. ((, 0&{::) ; (+ 1&{::)) etx i. 5 3
773-
NB. empty arguments
774-
0 -: ] F.. + i. 0
775-
1 -: ] F.. * i. 0
776-
'domain error' -: ] F:. + etx i. 0
777-
'domain error' -: ] F:. * etx i. 0
778-
0 0 0 -: ] F.. + i. 0 3
779-
1 1 1 -: ] F.. * i. 0 3
780-
'domain error' -: ] F:. + etx i. 0 3
781-
'domain error' -: ] F:. * etx i. 0 3
782-
'domain error' -: ] F.. $ etx i. 0
783-
784-
NB. one item
785-
999 -: +/ F.. (,~) 999
786-
(0$0) -: +/ F:. (,~) 999
787-
999 -: +/ F.. (,~) ,999
788-
(0$0) -: +/ F:. (,~) ,999
789-
999 -: ] F.. (,~) 999
790-
(0$0) -: ] F:. (,~) 999
791-
999 -: ] F.. (,~) ,999
792-
(0$0) -: ] F:. (,~) ,999
793-
9 -: +/ F.. (,~) ,: 2 3 4
794-
(0$0) -: +/ F:. (,~) ,: 2 3 4
795-
2 3 4 -: ] F.. (,~) ,: 2 3 4
796-
(0 3$0) -: ] F:. (,~) ,: 2 3 4
797-
798-
NB. one item - dyad
799-
999 -: 999 +/ F.. (,~) ''
800-
(0$0) -: 999 +/ F:. (,~) ''
801-
999 -: (,999) +/ F.. (,~) ''
802-
(0$0) -: (,999) +/ F:. (,~) ''
803-
999 -: 999 ] F.. (,~) ''
804-
(0$0) -: 999 ] F:. (,~) ''
805-
(,999) -: (,999) ] F.. (,~) ''
806-
(0 1$0) -: (,999) ] F:. (,~) ''
807-
9 -: 2 3 4 +/ F.. (,~) ''
808-
2 3 4 -: 2 3 4 ] F.. (,~) ''
809-
2 3 4 -: 2 3 4 ] F.. (,~) ''
810-
2 3 4 -: 2 3 4 ] F.. (,~) ''
811-
(0$0) -: 2 3 4 +/ F:. (,~) ''
812-
(0$0) -: 2 3 4 +/ F:. (,~) ''
813-
(0 3$0) -: 2 3 4 ] F:. (,~) ''
814-
(0 3$0) -: 2 3 4 ] F:. (,~) ''
815-
816-
817-
NB. F. F:
818-
102 51 154 77 232 116 58 29 88 44 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 -: ([ _2 Z: 1 = {:) F. (, -:`(1 3&p.)@.(2&|)@{:) 102
819-
51 154 77 232 116 58 29 88 44 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 -: (([ _2 Z: 1 = ])@{:) F: (, -:`(1 3&p.)@.(2&|)@{:) 102
820-
102 51 154 77 232 116 58 29 88 44 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 -: ([ _2 Z: 1 = {: [ _1 Z: 88 = {:) F. (, -:`(1 3&p.)@.(2&|)@{:) 102
821-
51 154 77 232 116 58 29 44 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 -: (([ _2 Z: 1 = ] [ _1 Z: 88 = {:)@{:) F: (, -:`(1 3&p.)@.(2&|)@{:) 102
822-
102 51 154 77 232 116 58 29 88 44 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 -: ([ _2 Z: 1 = {:) F. (([ 0 Z: 88 = {:)@(, -:`(1 3&p.)@.(2&|)@{:)) 102
823-
51 154 77 232 116 58 29 44 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 -: (([ _2 Z: 1 = ])@{:) F: (([ 0 Z: 88 = {:)@(, -:`(1 3&p.)@.(2&|)@{:)) 102
824-
102 51 154 77 232 116 58 29 -: ([ 0 Z: 88 = {:) F. (([ 1 Z: 88 = {:)@(, -:`(1 3&p.)@.(2&|)@{:)) 102
825-
51 154 77 232 116 58 29 -: (([ 0 Z: 88 = ])@{:) F: (([ 1 Z: 88 = {:)@(, -:`(1 3&p.)@.(2&|)@{:)) 102
826-
NB. empty result
827-
'domain error' -: ([ _2 Z: 51 = {:) F: (, -:`(1 3&p.)@.(2&|)@{:) etx 102
828-
'domain error' -: ([ _2 Z: 51 = {:) F. (, -:`(1 3&p.)@.(2&|)@{:) etx 102
829-
830-
a =: 3 : 0
831-
t =: t + 1
832-
_3 Z: 1000
833-
834-
0
835-
)
836-
'fold limit' -: ] F. a etx t =: 0
837-
t -: 1000 NB. quit after 1000 tries
719+
NB. f/ NaN --------------------------------------------------------------
720+
721+
'NaN error' -: +/ etx _ __ NB. smoke test
722+
723+
'NaN error' -: +/ etx (_ __ ([)`(2 ? #@])`]} ]) (2 + ? 100) ?@$ 0
724+
'NaN error' -: +/ etx ((,._ __) ([)`([: < 2 1 <@? $@])`]} ]) (2 + ? 50 50) ?@$ 0
725+
'NaN error' -: +/"2 etx ((,._ __) ([)`([: < 1 2 1 <@? $@])`]} ]) (2 + ? 4 50 50) ?@$ 0
726+
727+
'NaN error' -: -/ etx (_ __ ([)`(2 * 2 ? <.@:-:@:#@])`]} ]) (4 + ? 100) ?@$ 0
728+
'NaN error' -: -/ etx ((,._ __) ([)`([: < 2 *&.> 2 1 <@? <.@:-:@:$@])`]} ]) (4 + ? 50 50) ?@$ 0
729+
'NaN error' -: -/"2 etx ((,._ __) ([)`([: < 2 *&.> 1 2 1 <@? <.@:-:@:$@])`]} ]) (4 + ? 4 50 50) ?@$ 0
730+
838731

839732
9!:19 ct
840733

test/g600.ijs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ f=: 4 : 0
185185
(t -: , x <@;"1 0 y) , (5 5$"1 x) -: x f"1 0 y [ t=: '' [ mm=: ?*/$x
186186
(t -: , x <@;"1 y) , x -: x f"1 y [ t=: '' [ mm=: ? #x
187187

188-
testlen =: 10000 NB. following is slow during memaudit
188+
testlen =: QKTEST{10000 100 NB. following is slow during memaudit
189189
NB. Verify all kinds of changes of shape and precision. This is testing assembly, which is common to monad & dyad
190190
ops =: (0$0);(0$'a');(0$4);(0$1.5);(0$1j1);(0$a:);(0$5x);(0$4r6);(0$u:'a');(0$10 u:'a')
191191
ops =: ops , (0 1$0);(1 0$'a');(0 2$4);(2 0$1.5);(0 1 3$a:);(3 2 0$5x);(1 0 4$4r6);(4 0 5$u:'a');(0 5 0$10 u:'a')

test/gfold.ijs

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
prolog './gfold.ijs'
2+
NB. Fold F. F.. F.: F: F:. F:: -----------------------------------------
3+
4+
5+
NB. monad
6+
10 -: ] F.. + i. 5
7+
10 -: ] F.: + i. 5
8+
2 -: ] F.. - i. 5
9+
2 -: ] F.: - i. 5
10+
1 3 6 10 -: ] F:. + i. 5
11+
7 9 10 10 -: ] F:: + i. 5
12+
1 1 2 2 -: ] F:. - i. 5
13+
_1 3 _2 2 -: ] F:: - i. 5
14+
NB. dyad
15+
110 -: 100 ] F.. + i. 5
16+
110 -: 100 ] F.: + i. 5
17+
_98 -: 100 ] F.. - i. 5
18+
_98 -: 100 ] F.: - i. 5
19+
100 101 103 106 110 -: 100 ] F:. + i. 5
20+
104 107 109 110 110 -: 100 ] F:: + i. 5
21+
_100 101 _99 102 _98 -: 100 ] F:. - i. 5
22+
_96 99 _97 98 _98 -: 100 ] F:: - i. 5
23+
NB. Using v
24+
315 339 381 441 519 -: (6;100 101 102) (+/@:;) F:. ((, 0&{::) ; (+ 1&{::)) i. 5 3
25+
387 447 489 513 519 -: (6;100 101 102) (+/@:;) F:: ((, 0&{::) ; (+ 1&{::)) i. 5 3
26+
NB. early termination
27+
9 21 42 -: (6;100 101 102) (+/@:(0&{::) [ _2 Z: 9 e. 0&{::) F:. ((, 0&{::) ; (+ 1&{::)) i. 5 3
28+
9 21 72 111 -: (6;100 101 102) (+/@:(0&{::) [ _1 Z: 42 = [: +/ 0&{::) F:. ((, 0&{::) ; (+ 1&{::)) i. 5 3
29+
9 21 72 111 -: (6;100 101 102) (+/@:(0&{::) [ 0 Z: 42 = [: +/ 0&{::) F:. ((, 0&{::) ; (+ 1&{::)) i. 5 3
30+
9 21 42 -: (6;100 101 102) (+/@:(0&{::) [ 1 Z: 42 = [: +/ 0&{::) F:. ((, 0&{::) ; (+ 1&{::)) i. 5 3
31+
NB. early termination in u
32+
9 21 42 -: (6;100 101 102) (+/@:(0&{::)) F:. (([ _2 Z: 9 e. 0&{::)@:((, 0&{::) ; (+ 1&{::))) i. 5 3
33+
9 21 51 90 -: (6;100 101 102) (+/@:(0&{::)) F:. (([ _1 Z: 42 = [: +/ 0&{::)@((, 0&{::) ; (+ 1&{::))) i. 5 3
34+
9 21 72 111 -: (6;100 101 102) (+/@:(0&{::)) F:. (([ 0 Z: 42 = [: +/ 0&{::)@((, 0&{::) ; (+ 1&{::))) i. 5 3
35+
9 21 42 -: (6;100 101 102) (+/@:(0&{::)) F:. (([ 1 Z: 42 = [: +/ 0&{::)@((, 0&{::) ; (+ 1&{::))) i. 5 3
36+
NB. check uncaught throw
37+
dbr 1
38+
9 21 42 -: (6;100 101 102) (+/@:(0&{::)) F:. (([ _2 Z: 9 e. 0&{::)@:((, 0&{::) ; (+ 1&{::))) i. 5 3
39+
9 21 51 90 -: (6;100 101 102) (+/@:(0&{::)) F:. (([ _1 Z: 42 = [: +/ 0&{::)@((, 0&{::) ; (+ 1&{::))) i. 5 3
40+
9 21 72 111 -: (6;100 101 102) (+/@:(0&{::)) F:. (([ 0 Z: 42 = [: +/ 0&{::)@((, 0&{::) ; (+ 1&{::))) i. 5 3
41+
9 21 42 -: (6;100 101 102) (+/@:(0&{::)) F:. (([ 1 Z: 42 = [: +/ 0&{::)@((, 0&{::) ; (+ 1&{::))) i. 5 3
42+
dbr Debug
43+
NB. empty results
44+
'domain error' -: (6;100 101 102) (+/@:(0&{::) [ _2 Z: 6 e. 0&{::) F:. ((, 0&{::) ; (+ 1&{::)) etx i. 5 3
45+
NB. empty arguments
46+
0 -: ] F.. + i. 0
47+
1 -: ] F.. * i. 0
48+
'domain error' -: ] F:. + etx i. 0
49+
'domain error' -: ] F:. * etx i. 0
50+
0 0 0 -: ] F.. + i. 0 3
51+
1 1 1 -: ] F.. * i. 0 3
52+
'domain error' -: ] F:. + etx i. 0 3
53+
'domain error' -: ] F:. * etx i. 0 3
54+
'domain error' -: ] F.. $ etx i. 0
55+
56+
NB. one item
57+
999 -: +/ F.. (,~) 999
58+
(0$0) -: +/ F:. (,~) 999
59+
999 -: +/ F.. (,~) ,999
60+
(0$0) -: +/ F:. (,~) ,999
61+
999 -: ] F.. (,~) 999
62+
(0$0) -: ] F:. (,~) 999
63+
999 -: ] F.. (,~) ,999
64+
(0$0) -: ] F:. (,~) ,999
65+
9 -: +/ F.. (,~) ,: 2 3 4
66+
(0$0) -: +/ F:. (,~) ,: 2 3 4
67+
2 3 4 -: ] F.. (,~) ,: 2 3 4
68+
(0 3$0) -: ] F:. (,~) ,: 2 3 4
69+
70+
NB. one item - dyad
71+
999 -: 999 +/ F.. (,~) ''
72+
(0$0) -: 999 +/ F:. (,~) ''
73+
999 -: (,999) +/ F.. (,~) ''
74+
(0$0) -: (,999) +/ F:. (,~) ''
75+
999 -: 999 ] F.. (,~) ''
76+
(0$0) -: 999 ] F:. (,~) ''
77+
(,999) -: (,999) ] F.. (,~) ''
78+
(0 1$0) -: (,999) ] F:. (,~) ''
79+
9 -: 2 3 4 +/ F.. (,~) ''
80+
2 3 4 -: 2 3 4 ] F.. (,~) ''
81+
2 3 4 -: 2 3 4 ] F.. (,~) ''
82+
2 3 4 -: 2 3 4 ] F.. (,~) ''
83+
(0$0) -: 2 3 4 +/ F:. (,~) ''
84+
(0$0) -: 2 3 4 +/ F:. (,~) ''
85+
(0 3$0) -: 2 3 4 ] F:. (,~) ''
86+
(0 3$0) -: 2 3 4 ] F:. (,~) ''
87+
88+
89+
NB. F. F:
90+
102 51 154 77 232 116 58 29 88 44 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 -: ([ _2 Z: 1 = {:) F. (, -:`(1 3&p.)@.(2&|)@{:) 102
91+
51 154 77 232 116 58 29 88 44 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 -: (([ _2 Z: 1 = ])@{:) F: (, -:`(1 3&p.)@.(2&|)@{:) 102
92+
102 51 154 77 232 116 58 29 88 44 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 -: ([ _2 Z: 1 = {: [ _1 Z: 88 = {:) F. (, -:`(1 3&p.)@.(2&|)@{:) 102
93+
51 154 77 232 116 58 29 44 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 -: (([ _2 Z: 1 = ] [ _1 Z: 88 = {:)@{:) F: (, -:`(1 3&p.)@.(2&|)@{:) 102
94+
102 51 154 77 232 116 58 29 88 44 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 -: ([ _2 Z: 1 = {:) F. (([ 0 Z: 88 = {:)@(, -:`(1 3&p.)@.(2&|)@{:)) 102
95+
51 154 77 232 116 58 29 44 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 -: (([ _2 Z: 1 = ])@{:) F: (([ 0 Z: 88 = {:)@(, -:`(1 3&p.)@.(2&|)@{:)) 102
96+
102 51 154 77 232 116 58 29 -: ([ 0 Z: 88 = {:) F. (([ 1 Z: 88 = {:)@(, -:`(1 3&p.)@.(2&|)@{:)) 102
97+
51 154 77 232 116 58 29 -: (([ 0 Z: 88 = ])@{:) F: (([ 1 Z: 88 = {:)@(, -:`(1 3&p.)@.(2&|)@{:)) 102
98+
NB. empty result
99+
'domain error' -: ([ _2 Z: 51 = {:) F: (, -:`(1 3&p.)@.(2&|)@{:) etx 102
100+
'domain error' -: ([ _2 Z: 51 = {:) F. (, -:`(1 3&p.)@.(2&|)@{:) etx 102
101+
102+
a =: 3 : 0
103+
t =: t + 1
104+
_3 Z: 1000
105+
106+
0
107+
)
108+
'fold limit' -: ] F. a etx t =: 0
109+
t -: 1000 NB. quit after 1000 tries
110+
111+
4!:55 ;:'a t'
112+
113+
114+
epilog''
115+

test/gipht.ijs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ x f0 0+x=: j./_1e4+2 1e4 4 ?@$ 2e4
3838
x f0 0+x=: x: 1e4 ?@$ 3e3
3939
x f0 0+x=: x: 1e4 4 ?@$ 3e3
4040
x f0 0+x=: %/x:0 1+2 1e4 ?@$ 3e3
41-
x f0 0+x=: %/x:0 1+2 1e4 4 ?@$ 3e3
41+
x f0 0+x=: %/x:0 1+(QKTEST{::2 1e4 4;2 100 4) ?@$ 3e3
4242
1 [ 9!:57 (2)
4343

4444
NB. possible garbage collect can louse up timing

test/gxco.ijs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ NB. 'domain error' -: x: etx _.
4848
((,%) ! 10*i.10) -: x:^:_1 (,%) ! 10*i.10x
4949
(12345 % ! 10*i.10) -: x:^:_1 ] 12345 % ! 10*i.10x
5050

51-
(+/&.(x:!.0)"1 -:!.0 ([:_1&x: [:+/"1 x:!.0)) 20 20?@$0
52-
(+/&.(x:!.0) -:!.0 ([:_1&x: [:+/ x:!.0)) 1000?@$0 NB.todo bump this to a more reasonable value--in particular, one that can properly stress the large superaccumulator--once extended-precision operations are fast
51+
(+/&.(x:!.0)"1 -:!.0 ([:_1&x: [:+/"1 x:!.0)) (QKTEST{::20 20;10 10)?@$0
52+
(+/&.(x:!.0) -:!.0 ([:_1&x: [:+/ x:!.0)) (QKTEST{1000 100)?@$0 NB.todo bump this to a more reasonable value--in particular, one that can properly stress the large superaccumulator--once extended-precision operations are fast
5353

5454

5555
(= x:) ,1 _1 */ 1e43 1e_43
@@ -81,7 +81,7 @@ f=: 4 : 0
8181
1
8282
)
8383

84-
(10000 4 {~ 9!:57 (0) [ 9!:57 (1)) f"0 ]2*10^2 3 9
84+
(((QKTEST{10000 100),4) {~ 9!:57 (0) [ 9!:57 (1)) f"0 ]2*10^(QKTEST{::2 3 9;2 3 3)
8585

8686
f1=: 4 : 0
8787
p=: (_1^x ?@$ 2) * x ?@$ y
@@ -94,7 +94,8 @@ f1=: 4 : 0
9494

9595
5 = 0.0+*:_1+2*(+%)/1e3#1x
9696

97-
e =: 1 + 1000 ?@$ 10 ^ 100x [ d =: 1 + 1000 ?@$ 10 ^ 100x NB. test conversion to float
97+
NB. e =: 1 + 1000 ?@$ 10 ^ (QKTEST{100x 10x) [ d =: 1 + 1000 ?@$ 10 ^ (QKTEST{100x 10x) NB. test conversion to float
98+
e =: 1 + (QKTEST{1000 10) ?@$ 10 ^ (QKTEST{100x 10x) [ d =: 1 + (QKTEST{1000 10) ?@$ 10 ^ (QKTEST{100x 10x) NB. test conversion to float
9899
3.2e_16 > >./ x:^:_1 | 1x - (% [: x:!.0 x:^:_1) e%d
99100

100101
NB. f1"0 ]10^2 3 9

0 commit comments

Comments
 (0)