Search found 238 matches

Return to advanced search

Re: Converting 128 bit decimal to Float

You are supposed to be able to convert from 1287 to 645 using ⎕dr: 1287 645 ⎕DR x but ⎕dr has not yet been extended as it should have. An error report had been previously filed about this. Meanwhile, you can use the following: ⎕fr←1287 x←○⍳12 ⎕dr x 1287 t←{⎕fr←645 ⋄ 0+⍵} x ⎕dr t 645 The dfn exploits...
by Roger|Dyalog
on Wed Oct 17, 2012 8:44 am
 
Forum: Language
Topic: Converting 128 bit decimal to Float
Replies: 5
Views: 16194

Re: Is this a hard problem?

> FYI: There's a slightly amended (by Jay Foad) version of rr in dfns.dws: http://dfns.dyalog.com/n_rr.htm I think John meant a corrected version. My version from last night has obvious errors. I should have refrained from posting in the middle of the night just before bed, and I should have QA-ed. ...
by Roger|Dyalog
on Tue Aug 07, 2012 6:29 pm
 
Forum: Functional Programming
Topic: Is this a hard problem?
Replies: 8
Views: 29352

Re: Is this a hard problem?

I got lazy and looked it up: http://en.wikipedia.org/wiki/Round-robin_tournament#Scheduling_algorithm . It can be coded in APL as follows. ⎕io←0 rr←{(m,2,⍵÷2)⍴0,(⍳m)⌽(2⍴m)⍴1+⍳m←⍵-1} rr 10 0 1 2 3 4 5 6 7 8 9 0 2 3 4 5 6 7 8 9 1 0 3 4 5 6 7 8 9 1 2 0 4 5 6 7 8 9 1 2 3 0 5 6 7 ...
by Roger|Dyalog
on Tue Aug 07, 2012 6:13 am
 
Forum: Functional Programming
Topic: Is this a hard problem?
Replies: 8
Views: 29352

Re: Name that tune

Since "hook" is (f g) ⍵ ←→ ⍵ f (g ⍵) ⍺ (f g) ⍵ ←→ ⍺ f (g ⍵) and f ummm g w ←→ (f ⍵) g ⍵ ⍺ f ummm g w ←→ (f ⍺) g ⍵ perhaps "left hook" is an appropriate name for ummm. ummm also resembles the til operator in Iverson and Whitney's 1982 paper, Practical Uses of a Model of APL http:/...
by Roger|Dyalog
on Tue May 29, 2012 9:07 pm
 
Forum: Functional Programming
Topic: Name that tune
Replies: 1
Views: 9423

Re: Power and J notation

Possibly an error in the scanner (tokenizer) and/or parser. I note the following:

Code: Select all
      2 * 0J○1
8.824977827

      0J○1
SYNTAX ERROR
      0J○1
     ∧

      2 * ○1
8.824977827
by Roger|Dyalog
on Mon Oct 03, 2011 11:10 am
 
Forum: Language
Topic: Power and J notation
Replies: 2
Views: 9354

Re: complex values close to integers

"Sufficiently close" is like tolerantly close except computed with a system parameter called fuzz instead of with ⎕ct. That is, x is sufficiently close to y if (|x-y)≤fuzz×(|x)⌈(|y). See http://www.jsoftware.com/jwiki/Essays/Tolerant_Comparison#RegionofTolerantEquality for a geometric inte...
by Roger|Dyalog
on Wed Aug 31, 2011 6:25 pm
 
Forum: Language
Topic: complex values close to integers
Replies: 1
Views: 6385

Re: Unique Values and Associated Indices

While waiting for the BAA meeting to start I had an idea, viz. , there is an alternative method in Dyalog APL for doing the key sum, using the +← construct: keysum←{ z←(⍴∪⍺)⍴0 z[(∪⍺)⍳⍺]+←⍵ z } 'mississippi' ,[¯0.5] ⍳11 m i s s i s s i p p i 0 1 2 3 4 5 6 7 8 9 10 'mississippi' keysum ⍳11 0 22 16 17 ...
by Roger|Dyalog
on Fri Jul 29, 2011 10:07 pm
 
Forum: Language
Topic: Unique Values and Associated Indices
Replies: 3
Views: 10620

Re: Unique Values and Associated Indices

"Key" is a vast topic but I will try to do it justice here. (Fools rush in, etc.) a. Concerning efficiency, you have to take into account whether key is a primitive operator and whether the interpreter recognizes common phrases involving key and implement them with special code. In J, key ...
by Roger|Dyalog
on Thu Jul 28, 2011 6:12 pm
 
Forum: Language
Topic: Unique Values and Associated Indices
Replies: 3
Views: 10620
Previous

Return to advanced search