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


< > BotCompany Repo | #1036160 // floatArrayToList (makes an ArrayList)

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

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

static <A> ArrayList<Float> floatArrayToList(float[] a) {
  if (a == null) null;
  ret floatArrayToList(a, 0, a.length);

// no range checking on from/to in the interest of speed
static <A> ArrayList<Float> floatArrayToList(float[] a, int from, int to) {
  if (a == null) null;
  ArrayList<Float> l = new(to-from);
  for (int i = from; i < to; i++) l.add(a[i]);
  ret l;

Author comment

Began life as a copy of #1030696

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mqqgnosmbjvj, wnsclhtenguj

No comments. add comment

Snippet ID: #1036160
Snippet name: floatArrayToList (makes an ArrayList)
Eternal ID of this version: #1036160/1
Text MD5: 4136774b637e37b6bf28629c128ce5fd
Transpilation MD5: 0f65d63f7cfe19d19ff65820a6efc9a0
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-10-01 09:49:00
Source code size: 385 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 8 / 19
Referenced in: [show references]