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

28
LINES

< > BotCompany Repo | #1003125 // div - make HTML <div>; also: divide BigIntegers, Complex and even doubles

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

Transpiled version (4760L) is out of date.

ifndef div_noHTML
sS div(O contents, O... params) {
  ret hdiv(contents, params);
}

sS div() {
  ret hdiv();
}
endifndef

static BigInt div(BigInt a, BigInt b) {
  ret a.divide(b);
}

static BigInt div(BigInt a, int b) {
  ret a.divide(bigint(b));
}

ifclass Complex
static Complex div(Complex a, double b) {
  ret Complex(a.re/b, a.im/b);
}
endif

static double div(double a, double b) { ret a/b; }
static double div(double a, int b) { ret a/b; }
static long div(long a, long b) { ret a/b; }
static int div(int a, int b) { ret a/b; }

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ekrmjmnbrukm, elmgxqgtpvxh, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1003125
Snippet name: div - make HTML <div>; also: divide BigIntegers, Complex and even doubles
Eternal ID of this version: #1003125/14
Text MD5: 93f415536045211f6b59b25a962d55e1
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-11-16 22:52:18
Source code size: 562 bytes / 28 lines
Pitched / IR pitched: No / No
Views / Downloads: 834 / 932
Version history: 13 change(s)
Referenced in: #1003127 - body - HTML <body> tag
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1007579 - hdiv - synonym of div - make HTML <div>
#1029868 - div_floatRight - make HTML <div> with float: right
#1030860 - div_class - HTML <div> with class as first argument
#1031446 - div_inv - make HTML <div> with inverse syntax (contents last)