Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
4
Task/Arithmetic-Rational/J/arithmetic-rational-1.j
Normal file
4
Task/Arithmetic-Rational/J/arithmetic-rational-1.j
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
(x: 3) % (x: -4)
|
||||
_3r4
|
||||
3 %&x: -4
|
||||
_3r4
|
||||
2
Task/Arithmetic-Rational/J/arithmetic-rational-10.j
Normal file
2
Task/Arithmetic-Rational/J/arithmetic-rational-10.j
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
(#~ is_perfect_rational"0) (* <:@+:) 2^i.10x
|
||||
6 28 496 8128
|
||||
28
Task/Arithmetic-Rational/J/arithmetic-rational-2.j
Normal file
28
Task/Arithmetic-Rational/J/arithmetic-rational-2.j
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
| _3r4 NB. absolute value
|
||||
3r4
|
||||
-2r5 NB. negation
|
||||
_2r5
|
||||
3r4+2r5 NB. addition
|
||||
23r20
|
||||
3r4-2r5 NB. subtraction
|
||||
7r20
|
||||
3r4*2r5 NB. multiplication
|
||||
3r10
|
||||
3r4%2r5 NB. division
|
||||
15r8
|
||||
3r4 <.@% 2r5 NB. integer division
|
||||
1
|
||||
3r4 (-~ <.)@% 2r5 NB. remainder
|
||||
_7r8
|
||||
3r4 < 2r5 NB. less than
|
||||
0
|
||||
3r4 <: 2r5 NB. less than or equal
|
||||
0
|
||||
3r4 > 2r5 NB. greater than
|
||||
1
|
||||
3r4 >: 2r5 NB. greater than or equal
|
||||
1
|
||||
3r4 = 2r5 NB. equal
|
||||
0
|
||||
3r4 ~: 2r5 NB. not equal
|
||||
1
|
||||
4
Task/Arithmetic-Rational/J/arithmetic-rational-3.j
Normal file
4
Task/Arithmetic-Rational/J/arithmetic-rational-3.j
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
x: 3%4
|
||||
3r4
|
||||
x:inv 3%4
|
||||
0.75
|
||||
4
Task/Arithmetic-Rational/J/arithmetic-rational-4.j
Normal file
4
Task/Arithmetic-Rational/J/arithmetic-rational-4.j
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
>: 3r4
|
||||
7r4
|
||||
<: 3r4
|
||||
_1r4
|
||||
7
Task/Arithmetic-Rational/J/arithmetic-rational-5.j
Normal file
7
Task/Arithmetic-Rational/J/arithmetic-rational-5.j
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
mutadd=:adverb define
|
||||
(m)=: (".m)+y
|
||||
)
|
||||
|
||||
mutsub=:adverb define
|
||||
(m)=: (".m)-y
|
||||
)
|
||||
7
Task/Arithmetic-Rational/J/arithmetic-rational-6.j
Normal file
7
Task/Arithmetic-Rational/J/arithmetic-rational-6.j
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
n=: 3r4
|
||||
'n' mutadd 1
|
||||
7r4
|
||||
'n' mutsub 1
|
||||
3r4
|
||||
'n' mutsub 1
|
||||
_1r4
|
||||
1
Task/Arithmetic-Rational/J/arithmetic-rational-7.j
Normal file
1
Task/Arithmetic-Rational/J/arithmetic-rational-7.j
Normal file
|
|
@ -0,0 +1 @@
|
|||
is_perfect_rational=: 2 = (1 + i.) +/@:%@([ #~ 0 = |) ]
|
||||
2
Task/Arithmetic-Rational/J/arithmetic-rational-8.j
Normal file
2
Task/Arithmetic-Rational/J/arithmetic-rational-8.j
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
factors=: */&>@{@((^ i.@>:)&.>/)@q:~&__
|
||||
is_perfect_rational=: 2= +/@:%@,@factors
|
||||
4
Task/Arithmetic-Rational/J/arithmetic-rational-9.j
Normal file
4
Task/Arithmetic-Rational/J/arithmetic-rational-9.j
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
I.is_perfect_rational@"0 i.2^19
|
||||
6 28 496 8128
|
||||
I.is_perfect_rational@x:@"0 i.2^19x
|
||||
6 28 496 8128
|
||||
Loading…
Add table
Add a link
Reference in a new issue