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

20
LINES

< > BotCompany Repo | #1031939 // absDoubleMax

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

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

static double absDoubleMax(Iterable<Double> l) {
  double max = -Double.MAX_VALUE;
  fOr (double d : l)
    max = Math.max(max, abs(d));
  ret max;
}

static double absDoubleMax(double[] l) {
  double max = -Double.MAX_VALUE;
  fOr (double d : l)
    max = Math.max(max, abs(d));
  ret max;
}

static double absDoubleMax(double[] l, int from, int to) {
  double max = -Double.MAX_VALUE;
  for (int i = from; i < to; i++)
    max = Math.max(max, abs(l[i]));
  ret max;
}

Author comment

Began life as a copy of #1025079

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1031939
Snippet name: absDoubleMax
Eternal ID of this version: #1031939/1
Text MD5: 2665bcbee39a2511eebb20e3a911917c
Transpilation MD5: b092c49b5752e6b85d940f3f7c18e3f5
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:11:45
Source code size: 488 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 167 / 236
Referenced in: [show references]