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

13
LINES

< > BotCompany Repo | #1032994 // complex - make complex number (class Complex)

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

Libraryless. Click here for Pure Java version (3848L/22K).

static Complex complex(double re, double im) {
  ret Complex(re, im);
}

static Complex complex(double re) {
  ret Complex(re, 0.0);
}

static Complex complex(double[] reIm) {
  if (empty(reIm)) null;
  if (l(reIm) != 2) fail("Need 2 doubles to make complex number");
  ret complex(reIm[0], reIm[1]);
}

Author comment

Began life as a copy of #1032421

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1032994
Snippet name: complex - make complex number (class Complex)
Eternal ID of this version: #1032994/3
Text MD5: bd133576a47dc4a0eaae918ff887461d
Transpilation MD5: 89605ed6947b7f3f705f4356bd057172
Author: stefan
Category: javax / maths
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-18 01:10:32
Source code size: 314 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 178 / 296
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)