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
3 answers

Multiply each integer of a list by the integer of another list in Python

For a simulation scenario I'm generating 2 random lists. For example: my_list_1 = [17, 4, 22, 10, 18, 19, 23, 12] my_list_2 = [82] Just double checked the type of my_list_2 and the result is I need to create a new_list_3 with the…
Foldhy
  • 47
  • 1
  • 7
0
votes
1 answer

DAX to multiply two measures and the summarize the total

I am fairly new to Power BI and was hoping to solve my total (multiplication problem). I have running inventory table for supplies ordered. I need to have a breakdown of the cost of those supplies based on the last item ordered(prices constantly…
Atta
  • 1
  • 1
  • 1
0
votes
2 answers

Python integer and float multiplication error

The question seems dummy, but I cannot get it right. The output cm1 is expected to be floats, but I only get zeros and ones. import numpy as np import scipy.spatial.distance sim = scipy.spatial.distance.cosine a = [2, 3, 1] b = [3, 1, 2] c = [1,…
user3015347
  • 503
  • 3
  • 12
0
votes
2 answers

After multiplication, i want output to be in 2 decimals? how to do that?

I want to calculate multiplication from gien input. However, I want output to be not more than 2 decimals. For e.g. Multiplication of 12.24 and 13.17, is 161.2008. I want output truncated to 2 decimals, i.e. output should be 161.20. I am not a…
Ataullah
  • 35
  • 1
  • 4
0
votes
1 answer

Java Multiplication Table Formatting

I'm making a multiplication and here is a screenshot of what I'm trying to make: Final Product However, I cannot get the lines to format correctly. I think I have the correct code to perform the expressions... just need help formatting the table. Is…
0
votes
1 answer

C stops woking when a vaiable is multiplied and divided with double digit numbers

#include #include int main(void) { // TODO: Prompt for start size int s; do { s = get_int("Start size : "); } while (s < 9); // TODO: Prompt for end size int e; do { e =…
0
votes
2 answers

Issue multiplying a floating value

I am new to python so I appreciate your help! I am writing a simple code to read GPS data and print the speed value. The gps sends serial lines of text like…
0
votes
0 answers

Pandas Python multiply column values by chosing coeffiients from row of another dataframe

I can not figure out how to multiply a dataframe with the values selected as the row from another dataframe. I have a number of factors that I observe for variables in a universe: df_observations = pd.DataFrame([ ['variable_1', 1, 1.1, 1.2], …
JohnnieL
  • 1,192
  • 1
  • 9
  • 15
0
votes
2 answers

Multiply cell values with first column

I have a data frame that looks like the following sample_data <- data.frame(Cohort = c("Q1", "Q2", "Q3", "Q4"), Cohort.Size = c(120, 234, 345, 222), MO1 = c(8.3, 7.1, 2.4, 5.4), MO2 =…
emil_rore
  • 115
  • 1
  • 7
0
votes
1 answer

Multiple TypeErrors trying to multiply elements of a list inside a list comprehension

I am following a book on deep learning and the book encourages understanding basic math operations behind the more convenient numpy alternatives in order to better understand the underlying principles. I am trying to reconstruct numpy's…
0
votes
2 answers

Maximum Score from Performing Multiplication Operations

You are given two integer arrays nums and multipliers of size n and m respectively, where n >= m. The arrays are 1-indexed. You begin with a score of 0. You want to perform exactly m operations. On the ith operation (1-indexed), you…
AKSHAY
  • 23
  • 4
0
votes
1 answer

How to multiply numbers of a string by its position in the string

I am a newby on this. I am trying to multiply every single element of the string below ('10010010') by 2 to the power of the position of the element in the string and sum all the multiplications. So far I am trying to do it like this, but I cannot…
0
votes
1 answer

Multiplication of numbers that have sizes greater than a 64-bit register

For a 64-bit processor, the size of registers are 64 bits. So the maximum bits that can be multiplied together at a time are: a 32 bit number by a 32 bit number. Is this true or are there any other factors that determine the number of bits…
Mimi
  • 5
  • 2
0
votes
2 answers

How to check column that contain letter and number in Talend

My columns must contains 2 letter and 4 number like this (AV1234) How can i check this ?
DY_BI
  • 3
  • 2
0
votes
1 answer

array multiplication with integer

I have a 2D array "pop" in python. I want to multiply each element of column one with an integer. I used the following code temp[i] = b*pop[i,0]+a*pop[i,1] But it is returning error "list indices must be integers or slices, not tuple"
gauss
  • 3
  • 1