To: J3 J3/25-171 From: Van Snyder Subject: Edits if 25-170 "NORM2 needs a MASK argument" passes Date: 2025-September-26 Reference: 25-007 25-170 Edits ----- [384:+8 Table 16.1 Standard generic intrinsic procedure summary (cont.)] Replace the eighth entry on the page by "NORM2 (X [,MASK] ) or NORM2 (X, DIM [,MASK] T $L_2$ norm of an array" [457:12 16.9.153 NORM2 (X) or NORM2 (X,DIM)] Replace the title by "NORM2 (X [,MASK] ) or NORM2 (X, DIM [,MASK]) [457:17+ 16.9.153p3 Arguments] Insert an argument description "MASK(optional) shall be of type logical and shall be conformable with X." {with "conformable" linked to its definition}. [457:25-27 16.9.153p5 Result Value] Replace "Case(ii) ..." with two cases "Case(ii): The result of NORM2 (X, MASK=MASK) has a value equal to a processor-dependent approximation to the $L_2$ norm of the elements of X corresponding to true elements of MASK or has the value zero if there are no true elements. "Case(iii): If X has rank one, NORM2 (X, DIM=DIM [,MASK=MASK] ) has a value equal to that of NORM2 (X, MASK=MASK). Otherwise the value of elements ($s_1$, $s_2$, \dots, $s_\text{DIM-1}$, $s_\text{DIM+1}$, \dots $s_n$) of NORM2(X,DIM=DIM[,MASK=MASK]) is equal to NORM2(X($s_1$, $s_2$, \dots, $s_\text{DIM-1}$, :, $s_\text{DIM+1}$, \dots $s_n$) [,MASK=MASK($s_1$, $s_2$, \dots, $s_\text{DIM-1}$, :, $s_\text{DIM+1}$, \dots $s_n$)])." [457:39-31 16.9.153p7 Example] Replace the paragraph by "Examples. "Case(i): The value of NORM2([3.0,4.0]) is 5.0 (approximately). [ 1.0 2.0 ] "Case(ii): If X has the value [ ] then the value of [ 3.0 4.0 ] NORM2(X,DIM=1] is [3.162,4,472] (approximately) and the value of NORM2(X,DIM=2) is [2.236,5.0] (approximately). "Case(iii): If X has the value [ -3.0 -99.0 4.0 ] then the result of NORM2(X,MASK=(X > -99.0)) has the value 5.0 (approximately)." [457:31+ 16.9.153p7+ Example] Insert a note: "It is recommended that the processor use a method that does not cause overflow or underflow during the calculation if the value of the result does not underflow or overflow." ! One way that can be done is to compute Y = X / MAXVAL(ABS(X)) and ! calculate MAXVAL(ABS(X)) * NORM2(Y). A more efficient way is to ! proceed using the obvious method, and switch to the first method only ! if an overflow or underflow exception occurs. User programs cannot ! detect or handle exceptions.