Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
17
Task/Dot-product/PostScript/dot-product.ps
Normal file
17
Task/Dot-product/PostScript/dot-product.ps
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/dotproduct{
|
||||
/x exch def
|
||||
/y exch def
|
||||
/sum 0 def
|
||||
/i 0 def
|
||||
x length y length eq %Check if both arrays have the same length
|
||||
{
|
||||
x length{
|
||||
/sum x i get y i get mul sum add def
|
||||
/i i 1 add def
|
||||
}repeat
|
||||
sum ==
|
||||
}
|
||||
{
|
||||
-1 ==
|
||||
}ifelse
|
||||
}def
|
||||
Loading…
Add table
Add a link
Reference in a new issue