« first day (1809 days earlier)      last day (1142 days later) » 
01:00 - 22:0022:00 - 00:00

01:04
As part this challenge, you had to convert an adjacency list to an adjacency matrix. I spent a while on this in J, and my best effort was [:+/(-{.1:)"1@(,|."1). Very curious to see it bested, if anyone wants a micro challenge. cc/ @Bubbler
 
2 hours later…
03:31
@Jonah is there @ in J?
then you can create a matrix of 0s and amend 1s in the right place(maybe not as golfy)
{1@⍵⊢0⍴⍨⌈/⍵} in APL
 
1 hour later…
04:34
      a←3 3 3⍴⍳27
      +/⍤2⊢a
 6 15 24
33 42 51
60 69 78
      +/a
 6 15 24
33 42 51
60 69 78
      +/⍤3⊢a
 6 15 24
33 42 51
60 69 78
      +/⍤1 2⊢a
 6 15 24
33 42 51
60 69 78
honestly i am confused
no i was reading learnapl
what do you want to do with a
sum all columns
to get a length 3 vector
05:13
the best way may just be +⌿+⌿
i don't know if rank can do that in a single call
05:38
@Razetime J does have amend } and that was my first attempt. But it ends up being a handful of bytes longer than my more contorted solution. I did manage to shave 1 more byte off of it, but I'm out of other ideas.
06:36
i see
 
10 hours later…
16:22
Can I get "no padding" with Stencil?
17:06
@LdBeth I understand that whether or not you get padding depends on the shape of the arrays you use. (My understanding of Stencil and APL in general is very limited.)
@avx I read the CNN article and I found it quite good. Thanks for sharing!
By padding do you mean "fills"? In which case I think Alex is right, Stencil has an implicit mix so fills are no easier to avoid than they are with ↑ - shape has to be homogeneous. (I could be wrong)
You could always reduce the rank after using stencil and remove the fills yourself, depends on your use-case /shrug
17:29
CMC: print "Pi" if the input is the first X elements of 3 1 4 1 5, else "Not Pi"
@Fmbalbuena so if the input is any of 3, 3 1, 3 1 4, 3 1 4 1, 3 1 4 1 5?
@rak1507 yes
⋄ {(⊂⍵)∊,\⍎¨5↑⍕○1e4:'pi'⋄'not pi'}¨(3) (3 1 4) (3 1 5 6)
@FawnLocke
┌──┬──┬──────┐
│pi│pi│not pi│
└──┴──┴──────┘
You could set the precision to something smaller for code golf, which'd make it shorter,
This could also be shorter, and cleaner in a train
17:51
@FawnLocke I think @Fmbalbuena meant that the length should be programmable.
⋄ 5{(⊂⍵)∊,\⍎¨⍺↑⍕○1e4:'pi'⋄'not pi'}¨(3) (3 1 4) (3 1 5 6)
@AlexB
┌──┬──┬──────┐
│pi│pi│not pi│
└──┴──┴──────┘
Ah, well that's easy enough to do just replace 1e4 with 10* (power of) ⍺
⋄ 5{(⊂⍵)∊,\⍎¨⍺↑⍕○10*(⍺-1):'pi'⋄'not pi'}¨(3) (3 1 4) (3 1 5 6)
@AlexB
┌──┬──┬──────┐
│pi│pi│not pi│
└──┴──┴──────┘
⋄ 2{(⊂⍵)∊,\⍎¨⍺↑⍕○10*(⍺-1):'pi'⋄'not pi'}¨(3) (3 1 4) (3 1 5 6)
17:58
@AlexB
┌──┬──────┬──────┐
│pi│not pi│not pi│
└──┴──────┴──────┘
@Fmbalbuena You can use :Repeat etc. in the interactive session. In a dfn or tacit function, you have to wrap it in e.g. ⍎':for x :in ⍳3 ⋄ ⎕←x ⋄ :endfor' but TryAPL won't allow this.
@Fmbalbuena In the Windows IDE, you can press Ctrl+Del to remove a line (or all selected lines) from the session log. Any other way of removing lines will be temporary; next time you press Enter, they'll come back.
@Fmbalbuena Yes: {⍺←⊢ ⋄ ⍺1≢1} or {2∊⎕NC'⍺'}
@KamilaSzewczyk I don't know, but let me know if you want me to find out.
@Fmbalbuena apl.wiki/editors
@Adám it'd be cool if you found out.
@MasterQuiz If the language server isn't working, then I suggest you log an issue on GitHub.
@Razetime ⍸⍣¯1?
@PyGamer0 Because you're using /; use and it should make a whole lot more sense.
@LdBeth The left operand gets called with a vector indicating how much padding was added. This vector is perfect as left argument to in order to remove that added padding: ⎕←{⊂⍺↓⍵}⌺3 3⊢3 4⍴⍳12
18:20
@Adám
┌────┬───────┬────────┬─────┐
│1 2 │1 2 3  │2 3 4   │3 4  │
│5 6 │5 6 7  │6 7 8   │7 8  │
├────┼───────┼────────┼─────┤
│1  2│1  2  3│ 2  3  4│ 3  4│
│5  6│5  6  7│ 6  7  8│ 7  8│
│9 10│9 10 11│10 11 12│11 12│
├────┼───────┼────────┼─────┤
│5  6│5  6  7│ 6  7  8│ 7  8│
│9 10│9 10 11│10 11 12│11 12│
└────┴───────┴────────┴─────┘
That's awesome
@Fmbalbuena ⎕←{'not pi'↓⍨4×⊃⍵⍷⍎¨5↑⍕○1e4}¨(3) (3 1 4) (3 1 5 6)
@Adám
┌──┬──┬──────┐
│pi│pi│not pi│
└──┴──┴──────┘
did you mean that *at least* X digits of PI must be present?
If you meant this, I modified the code from @FawnLocke.
⋄ 3{(⍺↑⍵)≡⍎¨⍺↑⍕○10*(⍺-1):'pi' ⋄ 'not pi'}¨(3)(3 1 4)(3 1 5 6)
@AlexB
┌──────┬──┬──────┐
│not pi│pi│not pi│
└──────┴──┴──────┘
18:25
@Fmbalbuena is this what you meant?
@AlexB You need to think more array-oriented. Don't do if-else things!
That @ should've been directed at me
I was just hacking code from @FawnLocke for @Fmbalbuena.
But I get your point!
Ah, yes, sorry @AlexB. Well, there you have it, @FawnLocke :-)
Heh :)
18:52
⎕←{'not pi'↓⍨4×⊃⍵⍷⍎¨5↑⍕○1e4}¨(3)
@Fmbalbuena
┌──┐
│pi│
└──┘
⋄{'not pi'↓⍨4×⊃⍵⍷⍎¨5↑⍕○1e4}3 1 4
@Fmbalbuena pi
@AlexB yes
⋄{'not pi'↓⍨4×⊃⍵⍷⍎¨5↑⍕○1e4}3 1 4 1 5 9
@Fmbalbuena not pi
18:55
really yes
@KamilaSzewczyk The interpreter rarely uses a single algorithm for anything; it chooses dependent on the values presented at runtime. For factorials, most of the code appears to be related to Stirling's formula.
oh, that's somewhat surprising.
Spouge's approximation seems generally much better.
KamilaLisp has a cache of natural factorials up to 100 which are reused to compute further factorials, while real or imaginary values of "factorial" defined using the Gamma function are computed using Spouge's approximation.
@Adám Is possible to print regex that checks the divisibility of input number in APL
One good thing about it is that you can precompute the coefficients for a given precision in the compile-time, since APL is very primitive in the regard that it doesn't have arbitrary precision computation.
@Fmbalbuena If you have such a regex, then you can print it like any other character vector.
19:00
@Adám APL regex is PHP regex?
en.wikipedia.org/wiki/Spouge%27s_approximation - it's essentially a better version of Stirling's formula.
@Fmbalbuena Like PHP until before 7.3
(PHP 7.3 switched regex engine. We're planning on going that path too.)
I hope you don't insist on C++ regex :)
@Adám which language regex is APL regex?
from my observations, it's sometimes quicker to spawn a new PHP process and execute the regex there than use the C++'s <regex>.
19:03
@Fmbalbuena Same as PHP's pre-7.3, i.e. PCRE.
why did PHP move off PCRE? PCRE is very much fine. Is there a faster alternative maybe?
PCRE will not get any more updates. All development now happens on PCRE2, which is what PHP switched to.
@KamilaSzewczyk Stirling's formula was probably the only one around back in them ol' days.
Spouge's paper dates to 1994, so you might be right.
19:07
And even Lanczos dates from the same time as original APL.
@Fmbalbuena Oh, no, the typewriter (not printer) was just the interface, corresponding to the modern keyboard and screen in a single unit. The interpreter was cloud-based.
@Adám Ok
@Adám (except that "cloud" in 1975 meant just some water molecules up in the sky... the interpreter was probably running on a mainframe, like IBM/360) :-)
@Adám A command for me?
@AlexB I'm just trying to avoid having to explain old terminology. There's absolutely no difference between "on a mainframe" and "on someone's server" and "in the cloud".
@Adám I agree with you, but it sounded funny. I was saying that tongue-in-cheek.
19:17
@Fmbalbuena Dyadic is very simple. It simply concatenates (just like ,) but along the first axis. E.g.: ⋄ a←2 3⍴⍳6 ⋄ b←2 3⍴10×⍳6 ⋄ a,b ⋄ a⍪b
@Adám
1 2 3 10 20 30
4 5 6 40 50 60
 1  2  3
 4  5  6
10 20 30
40 50 60
⋄(2 3⍴(⍳2)-1)⍪(~2 3⍴(⍳2)-1)
@Fmbalbuena
0 1 0
1 0 1
1 0 1
0 1 0
⋄⎕JSON (2 3⍴(⍳2)-1)⍪(~2 2⍴(⍳2)-1)
@Fmbalbuena
LENGTH ERROR
      ⎕JSON(2 3⍴(⍳2)-1)⍪(~2 2⍴(⍳2)-1)
                       ∧
19:22
⋄(2 3⍴(⍳2)-1)⍪(~2 4⍴(⍳2)-1)
@Fmbalbuena
LENGTH ERROR
      (2 3⍴(⍳2)-1)⍪(~2 4⍴(⍳2)-1)
                  ∧
You can't concatenate things that don't match in shape.
@Adám How to do (2 3⍴(⍳2)-1)⍪(~2 4⍴(⍳2)-1)
What result are you expecting?
0 1 0 1 0 1 0
1 0 1 1 0 1 0
19:24
For matrices , concatenates horizontally and vertically.
Btw, ⎕JSON will fail on the result because JSON doesn't have multi-dimensional arrays.
@Adám [[1, 2], [3, 4]]?
That's a list of two lists.
[[1, 2], [3, 4], 2]?
19:26
That's a list of two lists and a number.
@Adám this is without conditionals, but I am sure you can do better... this is pretty much as far as I can get right now :-)
⋄ 3{∊(1+((⍺↑⍵)≡⍎¨⍺↑⍕○10*(⍺-1)))⌷'not pi' 'pi'}¨(3)(3 1 4)(3 1 5 6)
@AlexB
┌──────┬──┬──────┐
│not pi│pi│not pi│
└──────┴──┴──────┘
@AlexB Hint: "not pi" and "pi" are the same except for the first 4 characters.
 fadeev_leverrier←{
     (≠/⍴⍵)∨2≠⍴⍴⍵:⍬⋄n←⊃⍴⍵
     I←(,⍨⍴1↑⍨1∘+)n
     L←1⋄M←⍵∘{
         ⍵=0:(⍴⍺)⍴0⋄⍵=1:I
         x←⍺+.×⍺∇⍵-1
         L,←c←-(+/1 1⍉x)÷1-⍨⍵
         x+I×c
     }
     _←M n+1⋄L
 }
a sneak peek on my upcoming blog post
Wait i'll do
19:28
about characteristic polynomials, eigenvalues and determinants all at once in APL
@KamilaSzewczyk Do you use any sort of naming convention?
I - identity matrix
L - lambda
M - matrix
n - one of the matrix' dimensions
mathy code looks garbled since a lot of stuff in math uses single letter variable names
for instance, the coefficients of the characteristic polynomial are just lambda.
c and M are also derived from mathematics
I see. For me, it helps a lot to be able to instantly recognise the syntactic role of each identifier.
for me it's fairly simple, since I know the mathematical background behind my code.
(⍴⍺)⍴00×⍺?
19:30
oh. that's smart.
      )DIGITS 3
Invalid system command
What manual are you reading‽
i'm going to be improving this code further, or at least trying to.
@KamilaSzewczyk 2≠⍴⍴⍵ should be 2≠≢⍴⍵
why?
i guess that we can have even higher rank.
19:31
⋄ 3{(∊(~((⍺↑⍵)≡⍎¨⍺↑⍕○10*(⍺-1)))/⊂'not '),'pi'}¨(3)(3 1 4)(3 1 5 6)
and then the comparison fail due to scalar = vector
Wat?
@AlexB
┌──────┬──┬──────┐
│not pi│pi│not pi│
└──────┴──┴──────┘
wait, no
⍴⍴ yields you the rank, why change it.
@Adám youtube.com/… [onebox prevent]
19:32
@KamilaSzewczyk Because it gives a vector. Will bite you eventually.
fair.
i just like(d) the aesthetics of double rho
@Fmbalbuena Ah yes, some system specific have changed. use ⎕PP←3
@Adám how to print "WAS 10"
@KamilaSzewczyk n←⊃⍴⍵n←≢⍵
right.
i just really like rho.
19:33
@Fmbalbuena 'WAS',⎕PP ⋄ ⎕PP←3
      ⎕PP←3
      5÷3
1.666666667
Not working
@KamilaSzewczyk I←n n⍴1↑⍨1+n
@Fmbalbuena also that's an awesome video
i want to watch it at some point
⋄ 'WAS',⎕PP ⋄ ⎕PP←3 ⋄ 5÷3
@Adám
WAS 10
1.666666667
19:35
Huh, that's a bug in TryAPL then.
@Adám I said not working
wait
I'll test in my interpreter
done, but I am not able to reply and insert code in the same box.
⋄ 3{(∊(~((⍺↑⍵)≡⍎¨⍺↑⍕○10*(⍺-1)))/⊂'not '),'pi'}¨(3)(3 1 4)(3 1 5 6)
Works, but bug in TryAPL
@AlexB Just use two messages. They'll be merged visually.
@Adám ...but not with the "each" operator...?
19:37
Please use the Sandbox for experimenting with chat features.
@AlexB I don't follow.
@Adám not enough permissions to use the sandbox.
@Adám "∨" and "∧" seems useful
@AlexB you can gain rep by answering in some of codegolf.stackexchange.com challenges
@AlexB No worries, but Fmbalbuena can.
@Adám ha ha.... we were talking over each other's head... I thought you were talking about my code. Instead you were talking about the messaging.
:-D
@Fmbalbuena They are mostly used for OR and AND, but sometimes their extensions to number theory come in handy.
19:40
...and this because @Fmbalbuena put "a bug in my ear" and now I have to solve the challenge...
So you want little hints on improving your code?
@Adám greatest common divisor and lowest common multiple?
Yes.
@Adám please — but if I have a chance to get your help, I'd rather use it on another challenge.
Don't worry about using me :-)
19:42
⋄10∨45
@Fmbalbuena 5
⋄510∨2805
@Fmbalbuena 255
@AlexB Think about APL's order of operations. Whenever you see f(something) you can remove the parenthesis. E.g. you have *(⍺-1) and ~()
@AlexB Hint: ⋄ ''≡0/'Hello' ⋄ 'Hello'≡1/'Hello'
@Adám
1
1
19:47
/ with scalar left operand basically extends it, right?
⎕←2/'hi'
@KamilaSzewczyk hhii
this would disprove it
Disprove?
@Adám simplified a bit.
⋄ 3{((~(⍺↑⍵)≡⍎¨⍺↑⍕○10*⍺-1)/'not '),'pi'}¨(3)(3 1 4)(3 1 5 6)
@AlexB
┌──────┬──┬──────┐
│not pi│pi│not pi│
└──────┴──┴──────┘
19:51
@AlexB Combine ~ and into
why the left argument?
Alternative interpretation of the challenge.
@Adám of course! I forgot that ≢ exists! ha ha
⋄ 3{(((⍺↑⍵)≢⍎¨⍺↑⍕○10*⍺-1)/'not '),'pi'}¨(3)(3 1 4)(3 1 5 6)
@AlexB
┌──────┬──┬──────┐
│not pi│pi│not pi│
└──────┴──┴──────┘
19:54
@rak1507 I thought that's what @Fmbalbuena asked for. He wrote "X".
meaning "X" digits generically
@AlexB You could actually use 1e17 instead of computing the argument to
@Adám ???
@AlexB ah yeah I was interpreting it as checking if it was in ,\3 1 4 1 5
@AlexB Since you're taking the first digits, you'll discard any remaining digits.
Ah, but the print precision will hurt.
really the challenge should be to calculate the first n digits of pi with infinite precision using some fancy spigot algorithm or something
19:58
@AlexB Since you just want to know if is a prefix of the digits, you could do ⊃⍺⍷digits instead of the whole and business.
@Adám Got it, but 1e9 is as far as I can go.
Yeah, because the print precision will cause a switch to exponential format.
I don't think I want to push this challenge farther... @FawnLocke proposed it as a solution to @Fmbalbuena in like 5 seconds. It took me some time to understand it. It's a good exercise.
There are still plenty of things you could do with your solution, but that's fair.
@Adám Using the string is really a trick and it cannot be pushed too far.
@Adám I have my own challenges that I am working on...
20:01
@AlexB No, but a nice thing to learn is using : ⋄ (1×4)↓'not pi' ⋄ (0×4)↓'not pi'
@Adám
pi
not pi
@Adám Great! Thanks!
Selectively dropping chars. However, this is for code golf. In real code, if the output string changes, it won't work...
I use this a lot in production code, e.g. for selectively adding a plural s.
@Adám if you don't have to localize to anything else other than English...
Yeah, there's only one thing we produce that has localisation. (Well, two, kind of.)
@user5287 Hi Michał M. If you want to participate here, please email [email protected]
20:17
⋄ 3{(4×((⍺↑⍵)≡⍎¨⍺↑⍕○10*⍺-1))↓'not pi'}¨(3)(3 1 4)(3 1 5 6)
@AlexB
┌──────┬──┬──────┐
│not pi│pi│not pi│
└──────┴──┴──────┘
×(
⋄ 3{(4×(⍺↑⍵)≡⍎¨⍺↑⍕○10*⍺-1)↓'not pi'}¨(3)(3 1 4)(3 1 5 6)
@AlexB
┌──────┬──┬──────┐
│not pi│pi│not pi│
└──────┴──┴──────┘
Now, All you want to know is if is a prefix of ⍎¨⍕○10*⍺-1
You can check for prefixes with ⊃⍷
⋄ 'He'⍷'Hello' ⋄ 'Her'⍷'Hello'
20:20
@Adám
1 0 0 0 0
0 0 0 0 0
⋄ ⊃'He'⍷'Hello' ⋄ ⊃'Her'⍷'Hello'
@Adám
1
0
20:46
 solve←{
     ⎕io ⎕ml←0 1
     f←⍵⊥⍨⊢⋄g←{⍉⍵,[0.5]f¨⍵}
     X0←0.4J0.9*⍳1-⍨≢⍵
     ,1↑{
         v←,1↑⍵⋄g {
             (x y)←⍵
             x-y÷×/0~⍨x-v
         }⍤1⊢⍉⍵
     }⍣⍺⊢g X0
 }
@Adám what do you think of this code?
      50 solve 1 ¯3 3 ¯5
0.206299474J1.374729637 0.206299474J¯1.374729637 2.587401052J¯6.902100416E¯33
it's a numerical polynomial equation solver.
nothing fancy, just the Weierstrass method
I tried to make use of flat arrays here and no boxing or something
That's good.
f could be just ⊥∘⍵
oh, right.
I see you need my monadic < so you can write ,⍥< instead of ⍉,[0.5]
How about ⍵⍪⍉⍪f¨⍵
20:50
I considered using table here but i thought that using , with axis would be nicer.
evidently not, though
I personally dislike axis. You could do the same with Rank, though.
I guess
but Rank is more clunky and requires more code and strand prevention and everything.
Or ,[¯0.5] and lose the
i didn't know you can do that
It means concatenate them on a new axis before the first one.
20:51
APLcart examples in APL don't use negative axis at all
e.g. I{⍉2⊥∨/2⊥⍣¯1⍉⍺,[0.5]⍵}J
That's because it uses ⎕IO←1 throughout.
oh. i see.
Why x-y÷×/0~⍨x-v and not (-/⍵)÷×/0~⍨v-⍨⊃⍵ which means you can make the whole inner dfn inline?
because it's wrong :)
operator precedence bit you
Oops.
20:55
it's x - (y/something)
not (x-y)/something
Yeah.
{+/¯9 ¯11○(⊢×⎕ct<⊢)9 11○⍵} => this could have been SO cool with under
Wait a minute, is ⍉⍵ there a 2-column matrix?
yeah.
{⍵⍪⍉⍪f¨⍵} - that's how you make it
Then {⍺-⍵÷×/0~⍨⍺-v}⌿⍵ no?
20:57
out of a vector passed as omega.
it's a completely different thing
Wait, really?
now that you edited it, it's not
that's smart
You can remove the in ⍺⊢g
You can also remove ⎕ml1 because you're not using monadic or or
fair, i just did it during development and didn't care to remove it.
Getting rid of ,[] the only ⎕IO-sensitive place is so you don't need to localise ⎕IO, as you could write ⎕IO-⍨⍳
21:03
that's all great
Can we have an update printout of your function?
 solve←{
     f←⊥∘⍵⋄g←{⍵⍪⍉⍪f¨⍵}
     {+/¯9 ¯11○(⊢×⎕ct<|)9 11○⍵}¨,1↑{
         v←,1↑⍵⋄g{⍺-⍵÷×/0~⍨⍺-v}⌿⍵
     }⍣⍺ g 0.4J0.9*⎕io-⍨⍳1-⍨≢⍵
 }
oh, forgot the tack
Is it really necessary to split into Re and Im before doing the ⎕CT check?
Ah, wait, you're nulling small parts.
@KamilaSzewczyk {+/¯9 ¯11○(⊢×⎕ct<|)9 11○⍵}¨¯9 ¯11+.○(⊢×⎕ct<|)9 11∘.○
That's for all those that say function selector arguments are nasty!
21:23
@Adám No, that's not how I understood the challenge from @Fmbalbuena. For instance, ⍺ could be 3 and ⍵ could be 3 1 4 9. It would have to return "pi", because the first 3 digits match, though ⍵ ⍷ PI would fail.
Ah, so you want to know if ⍺↑⍵ is a prefix.
Then you can write ⊃(⍺↑⍵)⍷
Btw, using like this is cool for golfing, but don't do it in production code!
Yeah, I think it was the same size to just write 3 1 4 1 5 anyway, splitting a numeric scalar into it's digits is non-trivial though
10⊥⍣¯1?
That's fine but imprecise for large numbers
Not any more imprecise than the numbers themselves.
21:32
I suppose that's true
⋄ 10⊥⍣¯1○1e15 ⋄ 16⍕○1
@Adám
3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3
 3.141592653589793_
I would prefer if the output didn't use E notation by default
Even for giant numbers?
21:36
1E3000 might get annoying.
So you'd want it to fill with 0s or _s?
⋄ 3{(4×⊃(⍺↑⍵)⍷10⊥⍣¯1○1e15)↓'not pi'}¨(3)(3 1 4)(3 1 5 6)
@AlexB
┌──────┬──┬──────┐
│not pi│pi│not pi│
└──────┴──┴──────┘
Thanks, @Adám
No worries. One last thing for you: Have you heard of the operator?
Actually, yeah, nevermind. You'd need to display the missing precision or you'd get incorrect results, E notation is much more sensible than 0 v _s
21:39
@Adám It could keep all the digits, but shorten it with "..." ONLY in stdout.
@FawnLocke dzaima/APL
@FawnLocke You can set PP←34 to show as many digits as reasonable.
@FawnLocke Not necessarily. You could have unlimited precision. If you process the digits, then you have all of them. If it goes to stdout BY DEFAULT it could shorten it with "...".
@dzaima What do the three numbers mean?
@AlexB Uh, all the digits of pi?
21:41
@Adám 99 significant digits, use decimal notation for anything from e¯90 to e90
Ah.
@Adám Not ALL ha ha... up to the resolution you decide. In your example it was 1e3000
If you need 3000 digits and you're willing to burn some CPU time, you might get it.
@Adám floating-point numbers actually do have a maximum number of digits
@Adám Yes, I try to use it when I can.
21:44
@AlexB Well, that's not really entirely true: 'not pi'↓⍨
Floats are annoying wish we had infinitely fast computers
And infinitely large computers too, right?
of course
We'd need a bigger observable universe.
Unless of course we could shrink them infinitely…
Blackhole computing :)
21:46
@dzaima Why is it printing so few digits?
@Adám it truncates trailing zeroes. here's a version that doesn't
Just tried doing math.log10(math.factorial(10000)) in Python. Got 35659.45427452078.
Basically got 35659 digits of 10000!. In APL I got DOMAIN ERROR.
apl doesn't have infinite precision 10000! is too big
@dzaima Oh, OK, that's like 9999⍕ but filling with 0s instead of _s. Some APLs allow you to choose symbol for the fill. ⎕FMT can do it too.
In order to code APL you must first reinvent the universe
21:48
@rak1507 Dyalog APL doesn't.
math.log10(math.factorial(10000)+1.0) though fails in python. Python has bigintegers. APL doesn't
@Adám Alright...
⋄ 3{'not pi'↓⍨4×⊃(⍺↑⍵)⍷10⊥⍣¯1○1e15}¨(3)(3 1 4)(3 1 5 6)
@AlexB
┌──────┬──┬──────┐
│not pi│pi│not pi│
└──────┴──┴──────┘
I am stuck with this code... I really didn't want it... ha ha
@AlexB NARS2000:
      10⍟!10000
35659.45427
21:50
@rak1507 of course I know. The point is that Python has unlimited digits for integers. This would be a nice feature for APL, given the emphasis of this language.
@Adám not really - it's printing the precise value of pi rounded to an IEEE-754 64-bit float. Dyalog's 99⍕○1 gives a value that rounds towards it, but not the precise value itself
@AlexB We're planning that.
@Adám Can you get all 35659 digits?
Yes. I just did (well, I interrupted the output).
21:52
dzaima/APL fwiw:
https://dzaima.github.io/paste/#07d3Z0eXIkSzg95aCowANay4vlICqUYbRbSShf47TQoxZ1b3sqeU/OEBmZCzuHoF//eM8/u8///s/55Ff//7rfse7//m8zzWf9zrWX//6x9//dK1nXO8e69jnPN7nPdc@xnPe13md515j5c/ns473fI78xDX3vu5j7ufM77YrPud5P7nYPcfzPPec197HXGO@c65nzned71rPMa7zue5zvtda93Hk93cucJzvnS@d9z7e68l3jvNe18z/mc/KDVzPufPf@e78bl1r527nmmuvMz/@3ud1vPvJ823PkW89xjuOfPyd13GP477uPfc17ivfMaaHfGeumQuO68gNzO0Hn3zgHrlovnLPIx84zyv3nvtc@enc//ucxzPf93nGcz2503u8876PLEa@9B55qutdx/0@a4@Z6535rp3v3G8WIz8wj3OfxzzfXPg@3jWvlSueWZzxHO8488dzvPd6725IHi4X3Pt9s0VrnfnaO4uWP@51j/Hs27NkOc481JV/mVmE@RzZkCxhdyS3nAXOso5s2f3cY419vo8FO7I
@Adám So, how come I got error?
nars2000 is a different apl impl
Are you using NARS2000?
@Adám I am using Dyalog 18
@AlexB well, that's not NARS2000
21:55
⎕←'Dyalog 18'≡'NARS2000'
@Adám 0
Oh well ;-)
@Adám that's great news.
It appears NARS2000 does not support Linux?
Should run under Wine.
21:56
Gotcha
it does run under wine, but it's very finicky and buggy and doesn't respect xkb and has its own alt+ keyboard
@dzaima It doesn't respect keyboards on Windows either. I can't stand using it.
fun
01:00 - 22:0022:00 - 00:00

« first day (1809 days earlier)      last day (1142 days later) »