Libraryless. Click here for Pure Java version (3795L/22K).
1 | static double[] diffsBetweenDoubles(double[] l) { |
2 | int n = l(l); |
3 | if (n < 2) ret emptyDoubleArray(); |
4 | double[] diffs = new[n-1]; |
5 | for (int i = 1; i < n; i++) |
6 | diffs[i-1] = l[i]-l[i-1]; |
7 | ret diffs; |
8 | } |
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1032702 |
Snippet name: | diffsBetweenDoubles |
Eternal ID of this version: | #1032702/1 |
Text MD5: | 412c2ca95470eef2f695551731791ae2 |
Transpilation MD5: | a1c52154782295b5fd3c8d9d2b8f674d |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-02 05:16:09 |
Source code size: | 213 bytes / 8 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 139 / 201 |
Referenced in: | [show references] |