+/⍳10 ≠ 55

If we don't know about 'em, we can't fix 'em.

+/⍳10 ≠ 55

PostPosted by TheRavenDog » Sat Mar 11, 2017 9:50 pm

Am I confused?

Does not +/⍳10 mean "apply the addition operator to all elements from 10 to 1"

1+2+3+4+5+6+7+8+9+10 = 55.

But NARS2000 returns 50.


Version Information:
NARS2000 (Win64) Version # 0.5.0.300

MPIR Version #2.6.0
GMP Version #5.0.2
MPFR Version #3.1.2
MPC Version #1.0.3
ECM Version #6.4.4
COMCTL32.DLL Version #6.10 (win7_rtm.090713-1255)
CRASHRPT.DLL Version #2.0.16.0
Workspace version #0.02
SymTabSize 256
HshTabSize 256

Copyright © 2006-2017 Sudley Place Software
All rights reserved.
TheRavenDog
 
Posts: 7
Joined: Wed Jan 27, 2016 1:17 am

Re: +/⍳10 ≠ 55

PostPosted by forummaster » Sun Mar 12, 2017 12:39 am

TheRavenDog wrote:Am I confused?

Does not +/⍳10 mean "apply the addition operator to all elements from 10 to 1"

1+2+3+4+5+6+7+8+9+10 = 55.

But NARS2000 returns 50.

You are not confused -- I was. There was a misplaced parenthesis that caused +/ to return the wrong result for even length APVs. Thanks for the bug report. It is now fixed in the latest Alpha version:

http://www.nars2000.org/download/binaries/alpha/
forummaster
 
Posts: 554
Joined: Wed Jan 23, 2013 1:00 pm

Re: +/⍳10 ≠ 55

PostPosted by TheRavenDog » Wed Mar 15, 2017 7:55 pm

Thank you!

Incidentally, I wasn't trying be snarky when I asked "Am I confused?": I'm very new to APL and I'm often confused.

But I'm learning... slowly.

Thanks again.
TheRavenDog
 
Posts: 7
Joined: Wed Jan 27, 2016 1:17 am

Re: +/⍳10 ≠ 55

PostPosted by forummaster » Wed Mar 15, 2017 10:38 pm

TheRavenDog wrote:Thank you!

Incidentally, I wasn't trying be snarky when I asked "Am I confused?": I'm very new to APL and I'm often confused.

But I'm learning... slowly.

Thanks again.

I'm delighted to have you onboard! It's easy to learn APL at your own pace. There are some excellent tutorials on APL at http://aplwiki.com/PrimersAndTutorials and elsewhere.
forummaster
 
Posts: 554
Joined: Wed Jan 23, 2013 1:00 pm


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 3 guests

cron