noob question about pow
5 posts
• Page 1 of 1
noob question about pow
Dear All,
i start to use recursive D-fns, and i try sample in immediate selfhelp (F1).
on recursive page, i understand fact function.
but for pow function, i dont understand. it illustrate ∇∇ and use only ∇.
what's the crumble ?
other points : i paste in APL session, and it do an error :
i am lost outer space. can you help me to contact Houston ?
Great Thanks,
Yves
i start to use recursive D-fns, and i try sample in immediate selfhelp (F1).
on recursive page, i understand fact function.
but for pow function, i dont understand. it illustrate ∇∇ and use only ∇.
what's the crumble ?
other points : i paste in APL session, and it do an error :
pow←{ ⍝ Function power.i dont understand what can i do.
⍺=0:⍵ ⍝ Apply function operand ⍺ times.
(⍺-1)∇ ⍺⍺ ⍵ ⍝ ⍺⍺ ⍺⍺ ⍺⍺ ... ⍵
}
2 pow 5
VALUE ERROR
pow[1] ⍺=0:⍵ ⍝ Apply function operand ⍺ times.
∧
pow 5
SYNTAX ERROR
pow 5
∧
i am lost outer space. can you help me to contact Houston ?
Great Thanks,
Yves
- Yves
- Posts: 39
- Joined: Mon Nov 30, 2015 11:33 am
Re: noob question about pow
Welcome to the world of operators :)
In this case you need a function as the left operand.
Perhaps this gives some ideas:
-Veli-Matti
In this case you need a function as the left operand.
Perhaps this gives some ideas:
⍟⍟⍟⍟ 5000
¯0.2720968003
4 ⍟ pow 5000
¯0.2720968003
-Veli-Matti
- Veli-Matti
- Posts: 94
- Joined: Sat Nov 28, 2009 3:12 pm
Re: noob question about pow
Dear -Veli-Matti,
Great thanks for your help.
how to catch path simply with never error ? (i do always mistake or error)
usualy, i handcraft a trashable and piggy code.
Now, with your help, i do this :
possible my solution is not the better solution.
i appreciate yours comments on it.
Yves
Great thanks for your help.
'bee' ⎕wc 'form' ( 'coord' 'pixel' )
bee.AcceptFiles ← 1
bee.onDropFiles ← 'AffMsg'
┌→───────────────────────────────────────────────────────────┐
│ ┌→────────┐ ┌→────────────────────────────────┐ │
│ #.bee │DropFiles│ │ ┌→────────────────────────────┐ │ ¯1 0 │
│ └─────────┘ │ │C:\Users\user\Desktop\yes.dws│ │ │
│ │ └─────────────────────────────┘ │ │
│ └∊────────────────────────────────┘ │
└∊───────────────────────────────────────────────────────────┘
how to catch path simply with never error ? (i do always mistake or error)
disp 1↑ 2↓ chn
┌→────────────────────────────────────┐
│ ┌→────────────────────────────────┐ │
│ │ ┌→────────────────────────────┐ │ │
│ │ │C:\Users\user\Desktop\yes.dws│ │ │
│ │ └─────────────────────────────┘ │ │
│ └∊────────────────────────────────┘ │
└∊────────────────────────────────────┘
usualy, i handcraft a trashable and piggy code.
Now, with your help, i do this :
disp { (≡⍵) (⊃,/) pow ⍵ } 1↑ 2↓ chn
┌→────────────────────────────┐
│C:\Users\user\Desktop\yes.dws│
└─────────────────────────────┘
possible my solution is not the better solution.
i appreciate yours comments on it.
Yves
- Yves
- Posts: 39
- Joined: Mon Nov 30, 2015 11:33 am
Re: noob question about pow
Bonjour Yves ;-)
let me help to make it shorter:
with msg=
you can also do this:
let me help to make it shorter:
with msg=
- Code: Select all
┌→────────────────────────────────────────────────────────┐
│ ┌→────────┐ ┌→─────────────────────────────┐ │
│ #.bee │DropFiles│ │ ┌→─────────────────────────┐ │ ¯1 0 │
│ └─────────┘ │ │c:\User\desktop\yves.dws\)│ │ │
│ │ └──────────────────────────┘ │ │
│ └∊─────────────────────────────┘ │
└∊────────────────────────────────────────────────────────┘
you can also do this:
- Code: Select all
3 1⊃msg
┌→─────────────────────────┐
│c:\User\desktop\yves.dws\)│
└──────────────────────────┘
Last edited by Michael|Dyalog on Tue Sep 25, 2018 3:12 pm, edited 1 time in total.
- Michael|Dyalog
- Posts: 23
- Joined: Thu Mar 02, 2017 4:29 pm
Re: noob question about pow
Dear Michael & All,
Many Thanks for your help.
Before, i use only array with indexing.
Now, i see difference between them.
Thank you so much Michael
Guten Tag :-)
Many Thanks for your help.
Before, i use only array with indexing.
Now, i see difference between them.
]display str ← 'abc' 'def' 'ghi'
┌→──────────────────┐
│ ┌→──┐ ┌→──┐ ┌→──┐ │
│ │abc│ │def│ │ghi│ │
│ └───┘ └───┘ └───┘ │
└∊──────────────────┘
]display 2 ⊃ str
┌→──┐
│def│
└───┘
]display str[ 2 ]
┌───────┐
│ ┌→──┐ │
│ │def│ │
│ └───┘ │
└∊──────┘
Thank you so much Michael
Guten Tag :-)
- Yves
- Posts: 39
- Joined: Mon Nov 30, 2015 11:33 am
5 posts
• Page 1 of 1
Return to Functional Programming
Who is online
Users browsing this forum: No registered users and 0 guests
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group