Questions tagged [multiplication]

Multiplication is the mathematical operation of scaling one number by another. It is an elementary operation of most programming languages and is typically denoted by the symbol *.

Multiplication is the mathematical operation of scaling one number by another.

It is an elementary arithmetic operation in most programming languages along with addition, subtraction, division and sometimes modulo.

It is typically denoted by * (asterisk symbol) in programming, and × (cross symbol) in math.

Example (math): multiplication of numbers 3 and 4

3 × 4 = 12

See also: Multiplication on Wikipedia

2530 questions
0
votes
2 answers

Element-wise multiplication of a series of two lists from separate Pandas Dataframe Series in Python

I have a dataframe where there are two series, and each contains a number of lists. I would like to perform element-wise multiplication of each list in 'List A' with the corresponding list in 'List B'. df = pd.DataFrame({'ref': ['A', 'B', 'C',…
DataPap
  • 37
  • 3
0
votes
0 answers

list multiplication creates aliased lists instead of separate entities as other types

Why does this creates aliased arrays ?!! is this a expected behavior ? In [57]: p=[[]] * 3 In [58]: p[0].append(2) In [59]: p Out[59]: [[2], [2], [2]]
sten
  • 7,028
  • 9
  • 41
  • 63
0
votes
1 answer

Java: multiplying big numbers using linked lists

I am supposed to write a function that multiplies two big numbers which are in two linked lists. I need help figuring out an algorithm that does that the same way you would solve it on pen and paper. here is what i'm thinking of: I would use a…
Texasy04
  • 3
  • 2
0
votes
2 answers

Karotsuba multiplication - cannot find the error

I am doing the Stanford's Algorithms MOOC and got stuck with Karatsuba multiplication algorithm programming assignment. Karatsuba multiplication is simply an algorithm for multiplication of two integer that is asymptotically faster than usual…
0
votes
1 answer

How to find the maximum multiplication of two columns in SQL

I have a table which contains two columns. I want to find the maximum multiplication of these two columns and how many of them have this maxmimum value? I have tried the max of the multiplication of two columns But it didn't work. Any help will be…
Ellie
  • 1
  • 2
0
votes
2 answers

Lists with multiplication and addition Python

So I have a list that has numbers like [1,2,3,4,5]. What I need the code to be able to multiply and add the numbers so it would look like 1*5 + 2*4 + 3*3 + 4*2 + 5*1. Although these numbers can change based on user input, so it can also look like…
user13718657
0
votes
2 answers

How do I multiply values from different inputs to get a total using Javascript?

I am trying to do a shopping cart where I want the total to automatically change after the quantity is inputted (the total is the price times the quantity). I'm trying to use Javascript for this and I just can't seem to get it as it is coming up…
b07580
  • 41
  • 7
0
votes
1 answer

Multiplication manipulation b/w two df's in R

Input data : df1 <- data.frame(Category = c("a","b","c"), Col1 = c(0.1,0.25,0.03), Col2 = c(0.5,0.73,0.55), Col3 = c(0.043,0.66,0.07)) df2 <- data.frame(Category =…
Let's Code
  • 99
  • 7
0
votes
1 answer

How to solve factorial even numbers on the n number, then multiply them

For example there are 3 then the program will multiplying the first 3 factorials 2 x 4 x 6 = 48. For example if the user wants 3 then the program will multiply the first 3 factorials only and the sum value will decrease if the initial value is…
0
votes
1 answer

Floating point of fixed point division using Shift Operator in Verilog HDL

I want to ask if it is possible to divide the floating-point or fixed number using the shift operators. I want to divide the floating-point or fixed number in the power of 2? I know for decimal numbers we can use shift operators in Verilog HDL for…
0
votes
0 answers

Price calculation in Assembly language (TASM)

I am creating a restaurant program in assembly language which display a list of food together with its price. When user want to make an order, the program will prompt user to enter product number and enter the quantity of food they want to buy. The…
0
votes
1 answer

Multiply by a percentage increase in R

How do you multiply a number by a percentage increase in R. E.g. 43424 increasing by 120% would be 43424 * 2 + 43424 * 0.2 I have increases by 200% + and decreases in percentage as well
0
votes
1 answer

multiplying 3 numbers in assembly x86

So here is the numbers a = 234234 b = 2394729 c = 12323 a*b*c = 6912302836717278 but i am getting this result: 3945371358. I think i have to use LONG because it is over the int's limit but i don't know how ,because there is no long in…
FAR CRY 3
  • 37
  • 5
0
votes
1 answer

How is it possible that same lines of code work differently from time to time?

I've already noticed that simple multiplication in javascript sometimes gives incorrect results. By incorrect I don't mean floating value problem (2.999999 instead of 3) I mean absolutely incorrect result i.e. 2.6581 instead of 44.919283. I tried…
narra_kk
  • 111
  • 6
0
votes
1 answer

Multiplication by broadcasting rows of 2D array to each slice of 3D array using np.einsum

I have the arrays A and B: >>> import numpy as np >>> A = np.ones((3,3,2)) >>> B = np.array([ [0,0], [1,1], [2,2], ]) I want to multiply each row of B to each slice of A, such that each row of B gets broadcast over each slice of A,…
Naphat Amundsen
  • 1,519
  • 1
  • 6
  • 17
1 2 3
99
100