Libraryless. Click here for Pure Java version (87L/1K).
1 | static int absShortMax(short[] l) { |
2 | int x = 0; |
3 | if (l != null) for (short i : l) x = max(x, abs(i)); |
4 | ret x; |
5 | } |
6 | |
7 | static int absShortMax(short[] l, int start, int end) { |
8 | int x = 0; |
9 | for (int i = start; i < end; i++) |
10 | x = max(x, abs(l[i])); |
11 | ret x; |
12 | } |
Began life as a copy of #1024752
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1026897 |
Snippet name: | absShortMax - maximum absolute value of short array |
Eternal ID of this version: | #1026897/3 |
Text MD5: | d1a1e8f3d7b6657e29d3ee31d79eb568 |
Transpilation MD5: | 072e9c140af96c92e1d27fe30fef1ee7 |
Author: | stefan |
Category: | javax / maths |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-02-02 15:20:29 |
Source code size: | 269 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 263 / 369 |
Version history: | 2 change(s) |
Referenced in: | [show references] |