Multiply not working

I did add to this site, but could not get any answer

In my first part code I have
input 1(add amount in here)
input 2 (leave blank, get info from somewhere else)
multiply button
output (input1 * input2) (2*4=8)
This is working 100%

in my 2nd part code
input 1 (leave blank, get info from part 1 output)
input 2 (any number)
multiply button
output (output 1st part * input 2 2nd part ) (2*5=10)
Cannot get this to work
part 1 code

<font color="red"><b><label for="firstNum">CURRENCY:</label></b></font>
<input type="number" id="firstNum" name="firstNum">

<font color="PURPLE"><b><label for="secondNum">Total </label></b></font>
<input type="number" id="secondNum" name="secondNum">

<button onclick="multiply()">Multiply</button>

<font color="BLUE"><b><label for="result">Total</label></b></font>
<input type="text" id="result" name="result"/>

function multiply(){
    num1 = document.getElementById("firstNum").value;
    num2 = document.getElementById("secondNum").value = 1154.69514250;
    result = num1 * num2;
    document.getElementById("result").value = result.toLocaleString('en-US');


2nd part code

<font color="red"><b><label for="usd">leave blank( info from 1 total</label></b></font>
<input type="usdzar" id="usd" name="usd">

<font color="PURPLE"><b><label for="zar">Put ZAR in</label></b></font>
<input type="usdzar" id="zar" name="zar">

<button onclick="multiply1()">Multiply</button>

<font color="BLUE"><b><label for="result1">Total</label></b></font>
<input type="text" id="result1" name="result1"/>

function multiply1(){
    num3 = document.getElementById("result").value;
    num4 = document.getElementById("zar").value;
    result1 = num3 * num4;
    document.getElementById("result1").value = result.toLocaleString('en-US');



c++ – multiply a square matrix with the diagonal and antidiagonal elements different from zero in vector

So i have a square matrix with the diagonal and antidiagonal elements different from zero in a vector

vector<int> matrix = {1,2,3,4,5,6,7,8};

The matrix:

1 0 0 5
0 2 6 0
0 7 3 0
8 0 0 4

I try to multiply this with an other matrix

xmatrix is the class for matrices

I tried like this:

void xmatrix::operator*(const xmatrix& mat)
if(matrixSize != mat.getmatrixSize()) throw "Diff size";
int x;
for(int i = 0;i < matrixSize;i++){
    for(int j = 0;j < matrixSize;j++){
        x = 0;
        for(int k = 0;k < matrixSize;k++){
            x += getElement(i,k) * mat.getElement(k,j);

The var and func names clearly says it all

ATM this code works fine with the first half of the matrix(multiply with itself)

41 0 0 225
0 46 294 0
0 35 219 0
40 0 0 216

what other ways can work fine or how should i edit this code

Multiply lists: element-wise but matrix-like in the last 2 levels

How can I do the following computation more efficiently? We have nested lists and want to multiply element-wise, where the ‘element’ is the deepest 2 levels treated like normal matrix multiplication. And then we Total all but the last 2 levels. In reality I need to deal with larger size (like d1=300 but still small d2) lists many many times. Probably the following is not the optimal way to program it.

d1 = 10; d2 = 2;
mat1 = RandomComplex(1 + I, {d1, d1, d2, d2});
mat2 = RandomComplex(1 + I, {d1, d1, d2, d2});
mat3 = ConjugateTranspose(mat1);
data = Table(mat1((i, j)) . mat2((i, j)) . mat3((i, j)), {i, d1}, {j, d1});
Total(data, 2);

In Google Sheets, how can I multiply across two rows conditioned on whether a value exists in a given cell?

I have two tables that track sales seasonality as well as sales per person per month:


Seasonality Jan% Feb % Mar%
4.5% 6.0% 7.5%


Salesperson Jan$ Feb$ Mar$
John $1000 $1200
Jen $1350 $800

What I’d like to do is divide the sum of all months that have sales values (Jan$ – Feb$, for example) by the sum of the seasonality values through that month (Jan% – Feb%). Specifically, I’d like the sum of the seasonality to be limited, such that it won’t divide by the March seasonality number unless the March sales number has a number value (including a zero, but not a blank cell). I’d like to do this per row so that I can calculate per-salesperson seasonality.

Any thoughts on how to tackle this?

assembly – To multiply and then add four double precision point values through MIPS

I am assigned to write a program that should multiply and then add four double precision points values in MIPS I wrote the following code,

    doubleval1: .double  7.2
    doubleval2: .double 6.7
    doubleval3: .double 3.3
    doubleval4: .double 1.2
    l.d $f0,doubleval1 
    l.d $f2,doubleval2 
    mul.d $f12, $f0, $f2
    li $v0, 3
    l.d $f4,doubleval3
    l.d $f6,doubleval4
    mul.d $f12, $f4, $f6
    li $v0, 3

This code multiply all the predefined inputs, I want to ask can I add them all together? as it is the question requirement “then add four double precision points values”, Thank you.