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

12
LINES

< > BotCompany Repo | #1031940 // absDoubleMaxIndex

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

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

static int absDoubleMaxIndex(double[] l, int from, int to) {
  double max = -Double.MAX_VALUE;
  int idx = -1;
  for (int i = from; i < to; i++) {
    double d = abs(l[i]);
    if (d > max) {
      max = d;
      idx = i;
    }
  }
  ret idx;
}

Author comment

Began life as a copy of #1031939

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1031940
Snippet name: absDoubleMaxIndex
Eternal ID of this version: #1031940/3
Text MD5: 517ff69350b61df970c6677e42dce1a0
Transpilation MD5: 43e9b3aff8ad9dcabaee7efd411caf08
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-03 17:13:36
Source code size: 255 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 96 / 140
Version history: 2 change(s)
Referenced in: [show references]