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

6
LINES

< > BotCompany Repo | #1030695 // resizeDoubleArray

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

Libraryless. Click here for Pure Java version (2751L/16K).

1  
static double[] resizeDoubleArray(double[] a, int n) {
2  
  if (n == l(a)) ret a;
3  
  double[] b = new double[n];
4  
  arraycopy(a, 0, b, 0, min(l(a), n));
5  
  ret b;
6  
}

Author comment

Began life as a copy of #1023056

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030695
Snippet name: resizeDoubleArray
Eternal ID of this version: #1030695/1
Text MD5: 81f30d481d938ddf8dc06dc040df864b
Transpilation MD5: b3b01c34444ee8933665f843078c6c4d
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-03-08 12:23:44
Source code size: 163 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 219 / 301
Referenced in: [show references]