Skip to content

Commit c408632

Browse files
committed
revert nan->domain error
1 parent 4f84a48 commit c408632

15 files changed

Lines changed: 175 additions & 175 deletions

File tree

jsrc/as.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ static DF2(jtofxinv){A f,fs,z;C c;I t;V*v;
354354
fs=FAV(self)->fgh[0]; f=FAV(fs)->fgh[0]; v=FAV(f); c=v->id; t=AT(w); // self = f/\. fs = f/ f = f v = verb info for f
355355
if(!(c==CPLUS||c==CBDOT&&t&INT||((c&-2)==CEQ)&&t&B01))R outfix(a,w,self); // if not +/\. or m b./\. or =/\. or ~:/\.
356356
A z0,z1; z=irs2(df1(z0,w,fs),df2(z1,a,w,bslash(fs)),c==CPLUS?ds(CMINUS):f, RMAX,-1L,jtatomic2);
357-
if(jt->jerr==EVDOMAIN){RESETERR; R outfix(a,w,self);}else R z;
357+
if(jt->jerr==EVNAN){RESETERR; R outfix(a,w,self);}else R z;
358358
} /* a f/\. w where f has an "undo" */
359359

360360
static DF2(jtofxassoc){A f,i,j,p,s,x,z;C id,*zv;I c,d,k,kc,m,r,t;V*v;VA2 adocv;

jsrc/d.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ noeformat: ;
326326
}
327327
}
328328
// some errors are distinguished internally to make eformat easier. We revert them to the normal message after eformatting
329-
e=e==EVINHOMO?EVDOMAIN:e; e=e==EVNAN?EVDOMAIN:e; e=e==EVINDEXDUP?EVINDEX:e; e=e==EVEMPTYT?EVCTRL:e; e=e==EVEMPTYDD?EVCTRL:e; // revert internal numbers to external codes after formatting
329+
e=e==EVINHOMO?EVDOMAIN:e; e=e==EVINDEXDUP?EVINDEX:e; e=e==EVEMPTYT?EVCTRL:e; e=e==EVEMPTYDD?EVCTRL:e; // revert internal numbers to external codes after formatting
330330

331331
jt->jerr=jt->jerr1=e; // save reverted value
332332
jt->emsgstate|=EMSGSTATEFORMATTED; // indicate formatting attempted even if we skipped it

jsrc/i.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ static B jtevinit(JS jjt){A q,*v;JJ jt=MTHREAD(jjt);
103103
v[EVLENGTH ]=INCORPNA(cstr("length error" ));
104104
v[EVLIMIT ]=INCORPNA(cstr("limit error" ));
105105
v[EVLOCALE ]=INCORPNA(cstr("locale error" ));
106+
v[EVNAN ]=INCORPNA(cstr("NaN error" ));
106107
v[EVNONCE ]=INCORPNA(cstr("nonce error" ));
107108
v[EVNONNOUN]=INCORPNA(cstr("noun result was required" ));
108109
v[EVSPARSE ]=INCORPNA(cstr("non-unique sparse elements" ));
@@ -120,7 +121,6 @@ static B jtevinit(JS jjt){A q,*v;JJ jt=MTHREAD(jjt);
120121
v[EVTIME ]=INCORPNA(cstr("time limit" ));
121122
v[EVVALENCE]=INCORPNA(cstr("valence error" ));
122123
v[EVVALUE ]=INCORPNA(cstr("value error" ));
123-
v[EVNAN ]=v[EVDOMAIN];ras(v[EVNAN]);
124124
v[EVINHOMO ]=v[EVDOMAIN];ras(v[EVINHOMO]);
125125
v[EVINDEXDUP ]=v[EVINDEX];ras(v[EVINDEXDUP]);
126126
v[EVEMPTYT ]=v[EVCTRL];ras(v[EVEMPTYT]);

jsrc/va2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ DF2(jtsumattymes1){
11271127
}
11281128
#endif
11291129
NAN1;
1130-
}
1130+
}
11311131
RETF(z);
11321132
}
11331133

test/g030.ijs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ _ __ -: >: _ __
9999
_ __ eq + _ __
100100
_ __ eq _ __ + _ __
101101

102-
'domain error' -: _ + etx __
103-
'domain error' -: __ + etx _
102+
'NaN error' -: _ + etx __
103+
'NaN error' -: __ + etx _
104104

105105
*./, _ = _ + ?2 3$2
106106
*./, _ = _ + _1e9+?2 3 4$2e9
@@ -150,12 +150,12 @@ NB. _ __ __ _ -: _ _ __ __ *. _ __ _ __
150150
NB. _. _. eq 0 *. _ __
151151
NB. _. _. eq _ __ *. 0
152152

153-
'domain error' -: _ *. etx a=.?2 3$2
154-
'domain error' -: _ *. etx a=._1e9+?2 3 4$2e9
155-
'domain error' -: _ *. etx a=.o._1e9+?2 3 4$2e9
156-
'domain error' -: __ *. etx a=.?2 3$2
157-
'domain error' -: __ *. etx a=._1e9+?2 3 4$2e9
158-
'domain error' -: __ *. etx a=.o._1e9+?2 3 4$2e9
153+
'NaN error' -: _ *. etx a=.?2 3$2
154+
'NaN error' -: _ *. etx a=._1e9+?2 3 4$2e9
155+
'NaN error' -: _ *. etx a=.o._1e9+?2 3 4$2e9
156+
'NaN error' -: __ *. etx a=.?2 3$2
157+
'NaN error' -: __ *. etx a=._1e9+?2 3 4$2e9
158+
'NaN error' -: __ *. etx a=.o._1e9+?2 3 4$2e9
159159

160160
-. 128!:5 (2 (0 0;0 1;1 0)} 6 6$0) * 1 (0 0;0 1;1 0)} 6 6$_ NB. used to leave NaNs at the end
161161
-. 128!:5 (1 (0 0;0 1;1 0)} 6 6$_) * (2 (0 0;0 1;1 0)} 6 6$0)
@@ -167,8 +167,8 @@ __ _ -: - _ __
167167

168168
_ __ eq _ __ - __ _
169169

170-
'domain error' -: _ - etx _
171-
'domain error' -: __ - etx __
170+
'NaN error' -: _ - etx _
171+
'NaN error' -: __ - etx __
172172

173173
*./, _ = _ - ?2 3$2
174174
*./, _ = _ - _1e9+?2 3 4$2e9

test/g031.ijs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ _. -: _.
2323

2424
8 -: (3!:0) _.
2525

26-
'domain error' -: ex '_. ". ''circ'''
26+
'NaN error' -: ex '_. ". ''circ'''
2727

2828

2929
NB. conversion of _0 to 0 in place --------------------------------------

test/g110.ijs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ rk =: 1 : ('+"u b. 0')
3434

3535
0 0j1 0j_1 -: * 0 j. 0 _ __
3636
1 _1 = * _ __ j. 0
37-
(<'domain error') = * etx&.> j./~ _ __
37+
(<'NaN error') = * etx&.> j./~ _ __
3838

3939
'domain error' -: * etx 'abc'
4040
'domain error' -: * etx u:'abc'

test/g200.ijs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ NB. x m&|@^ y -----------------------------------------------------------
278278
0 = 2 (01&|@^) 2+1e9
279279
0 = 2 (01&|@^) 3+1e9
280280

281-
'domain error' -: 2 (1&|@^) etx 1+1e9
281+
'NaN error' -: 2 (1&|@^) etx 1+1e9
282282

283283
6 = 2 (10&|@^) 1e9
284284
2 = 2 (10&|@^) 1+1e9

test/g300.ijs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@ NB. 6!:6 arch NB. Restore AVX
161161
0 -: _ 0 _ +/ .* 0 _ 0
162162
0 -: _ 0 _ +/ .*~0 _ 0
163163

164-
'domain error' -: _1 1 (+/ .*)"1 etx _ _
165-
'domain error' -: _1 1 1 (+/ .*)"1 etx _ _ 5
166-
'domain error' -: 1 _1 1 (+/ .*)"1 etx 5 _ _
167-
'domain error' -: _1 1 1 (+/ .*)"1 etx _ 5 _
168-
'domain error' -: _1 1 1 (+/ .*)"1 etx _ 0 _
169-
'domain error' -: _1 1 1 (+/ .*)"1 etx _ _ _
164+
'NaN error' -: _1 1 (+/ .*)"1 etx _ _
165+
'NaN error' -: _1 1 1 (+/ .*)"1 etx _ _ 5
166+
'NaN error' -: 1 _1 1 (+/ .*)"1 etx 5 _ _
167+
'NaN error' -: _1 1 1 (+/ .*)"1 etx _ 5 _
168+
'NaN error' -: _1 1 1 (+/ .*)"1 etx _ 0 _
169+
'NaN error' -: _1 1 1 (+/ .*)"1 etx _ _ _
170170

171171
sh =. $@(+/ .*) -: }:@$@[ , }.@$@]
172172

test/g420.ijs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -697,13 +697,13 @@ iota =: > @ (+/&.>/) @ (i.&.> *&.> */\.@}.@(,&1))
697697

698698
NB. f/ NaN --------------------------------------------------------------
699699

700-
'domain error' -: +/ etx (_ __ ([)`(2 ? #@])`]} ]) (2 + ? 100) ?@$ 0
701-
'domain error' -: +/ etx ((,._ __) ([)`([: < 2 1 <@? $@])`]} ]) (2 + ? 50 50) ?@$ 0
702-
'domain error' -: +/"2 etx ((,._ __) ([)`([: < 1 2 1 <@? $@])`]} ]) (2 + ? 4 50 50) ?@$ 0
700+
'NaN error' -: +/ etx (_ __ ([)`(2 ? #@])`]} ]) (2 + ? 100) ?@$ 0
701+
'NaN error' -: +/ etx ((,._ __) ([)`([: < 2 1 <@? $@])`]} ]) (2 + ? 50 50) ?@$ 0
702+
'NaN error' -: +/"2 etx ((,._ __) ([)`([: < 1 2 1 <@? $@])`]} ]) (2 + ? 4 50 50) ?@$ 0
703703

704-
'domain error' -: -/ etx (_ __ ([)`(2 * 2 ? <.@:-:@:#@])`]} ]) (4 + ? 100) ?@$ 0
705-
'domain error' -: -/ etx ((,._ __) ([)`([: < 2 *&.> 2 1 <@? <.@:-:@:$@])`]} ]) (4 + ? 50 50) ?@$ 0
706-
'domain error' -: -/"2 etx ((,._ __) ([)`([: < 2 *&.> 1 2 1 <@? <.@:-:@:$@])`]} ]) (4 + ? 4 50 50) ?@$ 0
704+
'NaN error' -: -/ etx (_ __ ([)`(2 * 2 ? <.@:-:@:#@])`]} ]) (4 + ? 100) ?@$ 0
705+
'NaN error' -: -/ etx ((,._ __) ([)`([: < 2 *&.> 2 1 <@? <.@:-:@:$@])`]} ]) (4 + ? 50 50) ?@$ 0
706+
'NaN error' -: -/"2 etx ((,._ __) ([)`([: < 2 *&.> 1 2 1 <@? <.@:-:@:$@])`]} ]) (4 + ? 4 50 50) ?@$ 0
707707

708708

709709
NB. +/ Magic Cubes -----------------------------------------------------

0 commit comments

Comments
 (0)