Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #1026897 // absShortMax - maximum absolute value of short array

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (87L/1K).

static int absShortMax(short[] l) {
  int x = 0;
  if (l != null) for (short i : l) x = max(x, abs(i));
  ret x;
}

static int absShortMax(short[] l, int start, int end) {
  int x = 0;
  for (int i = start; i < end; i++)
    x = max(x, abs(l[i]));
  ret x;
}

Author comment

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: 176 / 261
Version history: 2 change(s)
Referenced in: [show references]