multiplication Questions

2

Solved

I am trying to write an JS algorithm in which I have two arrays. The value of the first one will have different numerical values. The second array will be constant, say for example [5, 3, 6, 8]. No...
Jaggy asked 30/6, 2021 at 13:53

3

Solved

I have the following table: from pyspark.sql import SparkSession, functions as F spark = SparkSession.builder.getOrCreate() cols = [ 'a1', 'a2'] data = [([2, 3], [4, 5]), ([1, 3], [2, 4])] df =...

2

Does anyone have (or can easily write) an optimal inline assembly function for the ARM Cortex M0+ processor in Thumb mode to multiply two 32-bit numbers and return a 64-bit number? As the M0+ does...
Sera asked 25/4, 2014 at 3:25

12

Solved

I hear this statement quite often, that multiplication on modern hardware is so optimized that it actually is at the same speed as addition. Is that true? I never can get any authoritative confirm...
Ushas asked 17/2, 2014 at 2:23

4

Solved

I have written programs in C++, Python and Java for matrix multiplication and tested their speed for multiplying two 2000 x 2000 matrices (see post). The standard ikj-implentation - which is in - t...
Neighboring asked 15/7, 2012 at 21:25

3

Solved

Is it possible to multiply two ndarray A, and B and add the result to C, without creating a large intermediate array for A times B? Numpy has the out keyword parameter for the case of C = A times ...
Subterranean asked 19/7, 2017 at 20:19

7

Solved

Consider the following as a reference implementation: /* calculates (a * b) / c */ uint32_t muldiv(uint32_t a, uint32_t b, uint32_t c) { uint64_t x = a; x = x * b; x = x / c; return x; } I a...
Deviled asked 10/11, 2010 at 12:0

15

Solved

I want to perform an element wise multiplication, to multiply two lists together by value in Python, like we can do it in Matlab. This is how I would do it in Matlab. a = [1,2,3,4] b = [2,3...
Exhilarant asked 22/4, 2012 at 19:45

2

I am trying to execute simple multiplication in Assembly. However, I do not see the registers change when the MUL function is called. mov bx, 5 mov cx, 10 mul cx
Rebeccarebecka asked 30/11, 2016 at 16:12

1

Solved

I am trying to multiply an array typed column by a scalar. This scalar is also a value from the same PySpark dataframe. For example, I have this dataframe: df = sc.parallelize([([1, 2],3)]).toDF([&...
Figwort asked 19/6, 2020 at 20:27

6

Solved

how do I multiply lists together in python using a function? This is what I have: list = [1, 2, 3, 4] def list_multiplication(list, value): mylist = [] for item in list: for place in value: ...
Humor asked 26/9, 2013 at 0:21

3

Solved

I have an assignment where I need to find the product of all of the numbers in an array, I'm not sure how to do this. int[] numbers = new int[SIZE]; Console.WriteLine("Type in 10 numbers"); C...
Hainaut asked 21/11, 2013 at 22:2

9

Solved

In the software I'm writing, I'm doing millions of multiplication or division by 2 (or powers of 2) of my values. I would really like these values to be int so that I could access the bitshift oper...
Celery asked 11/10, 2011 at 2:2

2

I'm using Django 2.0 and Python 3.7. I've read I can do multiplication in templates by using widthratio -- multiplication in django template without using manually created template tag . However, i...
Episodic asked 24/2, 2020 at 18:31

14

i've the following code in Javascript: var m1 = 2232.00; var percent = (10/100); var total = percent*m1; alert(total); The problem is that the variable "total" gives me "223.20000000000002" and ...
Dyeline asked 23/1, 2013 at 22:22

2

Consider that you want to calculate the low 128-bits of the result of multiplying a 64-bit and 128-bit unsigned number, and that the largest multiplication you have available is the C-like 64-bit m...
Kandykane asked 17/8, 2018 at 19:27

3

I have found out that both mul and imul can be used to multiply a signed number to an unsigned number. For example: global _start section .data byteVariable DB -5 section .text _start: mov al...
Everard asked 3/8, 2017 at 22:46

19

Solved

Multiplication and division can be achieved using bit operators, for example i*2 = i<<1 i*3 = (i<<1) + i; i*10 = (i<<3) + (i<<1) and so on. Is it actually faster to use ...
Posology asked 15/6, 2011 at 11:31

1

Solved

Recently, I've tried creating a for loop that multiplies each integer in the list and returns each sequential product until the overall product of all integers is given. import operator from oper...
Enroll asked 30/11, 2019 at 2:34

1

I am currenty converting the nacl library to risc-v. I already have poly1305 working. I am trying to do this using the risc-v core instruction set, so I don't have a multiplier. The algorithm for P...

3

Solved

I know how to design a 4x4 array multiplier , but if I follow the same logic , the coding becomes tedious. 4 x 4 - 16 partial products 64 x 64 - 4096 partial products. Along with 8 full adders ...
Paganini asked 23/5, 2013 at 7:45

5

Solved

Assume I have matrices P with the size [4, 4] which partitioned (block) into 4 smaller matrices [2,2]. How can I efficiently multiply this block-matrix into another matrix (not partitioned matrix b...
Zygodactyl asked 14/6, 2019 at 15:21

1

Solved

I am trying to get some trade information from an exchange websocket. Both values .p and .q are enclosed between double quotes in the JSON I get from the socket. When I try to multiply two values,...
Telles asked 2/7, 2019 at 23:49

8

Solved

Is booth algorithm for multiplication only for multiplying 2 negative numbers (-3 * -4) or one positive and one negative number (-3 * 4) ? Whenever i multiply 2 positive numbers using booth algorit...
Wrench asked 19/11, 2011 at 4:8

2

Solved

In fixed point math I use a lot of 16bit signals and perform multiplication with 32bit intermediate results. For example: int16_t a = 16384; //-1.0q14 or 1.0*2^14 int16_t b = -24576; // -1.4q14 or...
Eductive asked 6/6, 2013 at 15:51

© 2022 - 2024 — McMap. All rights reserved.