Skip to content

Commit 03e40f3

Browse files
committed
sin added tests failing
1 parent 6ef11f8 commit 03e40f3

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ the base, which must have the form B for a real bignum or 0JB for a complex bign
5858
BA←{BA} div BA ⍝ ÷ over Bignums
5959
BA←BA mod BA ⍝ | over Bignums
6060
BA←snh BA ⍝ 5○ over bignums
61-
BA←cis BA ⍝ 12○ over bignums
62-
61+
BA←cis BA ⍝ 12○ over bignums
62+
BA←sin BA ⍝ 1○ over bignums
63+
6364
### APL Primitive Operators
6465

6566
BA←BA bf dot bf BA ⍝ f.g over bignums

a.cd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ exp←{b←⊃bas⍵ ⋄ k←2⍟|b ⋄ s←(⌈/∘⌈k×0,∘,1+pla-ovr)⍵
7979
(pla ⍵)pla mul⍨⍣s⊢z add mul∘(z∘add)red(⊢div out (1+⍳r)big⍨⊢)di2⍣s⊢n pla⍵}
8080
snh←pla pla∘(di2 exp sub exp∘sub)≢pla⊢
8181
cis←{(pla⍵)pla exp r2c⍣(isr⍵)(≢pla 2∘↑⍪0⍪0J1×sg0)⍵}
82+
sin←{(pla⍵)pla rea⍣(isr⍵)(cry 3∘↑⍪0J¯1×3∘↓)(di2 cis sub cis∘sub)(≢pla⊢)⍵}
8283

8384
cat←⍪⍤¯1
8485
rav←,⍤¯1

mystika.dws

78.6 KB
Binary file not shown.

tests/sin_tests.dyalog

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
:Namespace sin_tests
2+
3+
⎕IO ⎕ML ⎕WX0 1 3
4+
5+
X{#.UT.expect} M#.mystika
6+
7+
SIN∆01_TEST{_X 10 21 0,(2010)0 M.sin 10 0 0,(2010)0}
8+
SIN∆02_TEST{_X 10 0 0,(2010)1 M.sin 10 19 0,¨'15707963267948966192'}
9+
SIN∆03_TEST{_X 10 0 0,(2010)0 M.sin 10 19 0,¨'31415926535897932384'}
10+
SIN∆04_TEST{_X 10 0 1,(2010)¯1 M.sin 10 19 0,¨'47123889803846898576'}
11+
SIN∆05_TEST{_X 10 0 0,(2010)0 M.sin 10 19 0,¨'62831853071795864769'}
12+
SIN∆06_TEST{_X 10 19 0,¨'90018436125947441551' M.sin 10 4 0,(2010)20214}
13+
SIN∆07_TEST{_X 10 19 1,¨'09981563874052558449' M.sin 10 4 1,(2010)¯20214}
14+
SIN∆08_TEST{_X M.r2c 10 16 0, -1 0J1+.ר'30662171147377330302' '26482645189580402287' M.sin 0J10 0 0,(200J10)4J9}
15+
SIN∆09_TEST{_X 100 19 190 0 10,¨'90018436125947441551' '09981563874052558449' M.sin 100 4 40 0 1(2010)0 20214 ¯20214}
16+
17+
:EndNamespace
18+
19+
20+
21+
22+
23+
24+
25+

0 commit comments

Comments
 (0)