Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Imaginary-base-numbers/J/imaginary-base-numbers-1.j
Normal file
19
Task/Imaginary-base-numbers/J/imaginary-base-numbers-1.j
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
ibdec=: {{
|
||||
0j2 ibdec y
|
||||
:
|
||||
digits=. 0,".,~&'36b'@> tolower y -.'. '
|
||||
(x #. digits) % x^#(}.~ 1+i.&'.')y-.' '
|
||||
}}"1
|
||||
|
||||
ibenc=: {{
|
||||
0j2 ibenc y
|
||||
:
|
||||
if.0=y do.,'0' return.end.
|
||||
sq=.*:x assert. 17 > sq
|
||||
step=. }.,~(1,|sq) +^:(0>{:@]) (0,sq) #: {.
|
||||
seq=. step^:(0~:{.)^:_"0
|
||||
're im0'=.+.y
|
||||
'im imf'=.(sign,1)*(0,|x)#:im0*sign=.*im0
|
||||
frac=. ,hfd (imf*|x)-.0 if.#frac do.frac=.'.',frac end.
|
||||
frac,~(}.~0 i.~_1}.'0'=]) }:,hfd|:0 1|."0 1 seq re,im
|
||||
}}"0
|
||||
41
Task/Imaginary-base-numbers/J/imaginary-base-numbers-2.j
Normal file
41
Task/Imaginary-base-numbers/J/imaginary-base-numbers-2.j
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
(ibenc i:16),.' ',.ibenc j.i:16
|
||||
1030000 2000
|
||||
1030001 2010.2
|
||||
1030002 2010
|
||||
1030003 2020.2
|
||||
300 2020
|
||||
301 2030.2
|
||||
302 2030
|
||||
303 1000.2
|
||||
200 1000
|
||||
201 1010.2
|
||||
202 1010
|
||||
203 1020.2
|
||||
100 1020
|
||||
101 1030.2
|
||||
102 1030
|
||||
103 0.2
|
||||
0 0
|
||||
1 0.2
|
||||
2 10
|
||||
3 10.2
|
||||
10300 20
|
||||
10301 20.2
|
||||
10302 30
|
||||
10303 30.2
|
||||
10200 103000
|
||||
10201 103000.2
|
||||
10202 103010
|
||||
10203 103010.2
|
||||
10100 103020
|
||||
10101 103020.2
|
||||
10102 103030
|
||||
10103 103030.2
|
||||
10000 102000
|
||||
(ibdec ibenc i:16),:ibdec ibenc j.i:16
|
||||
_16 _15 _14 _13 _12 _11 _10 _9 _8 _7 _6 _5 _4 _3 _2 _1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
||||
0j_16 0j_15 0j_14 0j_13 0j_12 0j_11 0j_10 0j_9 0j_8 0j_7 0j_6 0j_5 0j_4 0j_3 0j_2 0j_1 0 0j_1 0j2 0j1 0j4 0j3 0j6 0j5 0j8 0j7 0j10 0j9 0j12 0j11 0j14 0j13 0j16
|
||||
0j4 ibenc 42
|
||||
10e0a
|
||||
0j4 ibdec 0j4 ibenc 42
|
||||
42
|
||||
Loading…
Add table
Add a link
Reference in a new issue