I’m learning some basic arithmetic using NASM on Linux. I need to divide two numbers using variables NUMBER1 and NUMBER2. My code works if I type in actual value instead of variables. For example if I type in ‘6’ instead of NUMBER2 and ‘2’ instead of NUMBER1, the program does division and gives me answer of 3. Running code with
Tag: math
how to calculate percentage in shell
I would like to calculate percentage in shell. But I can’t do it. My script is It is neither showing any value nor terminating when executing this script. Answer awk will give you an n1 illegal field name if you do that, as it’s inside single quotes. Also, to avoid awk keep reading stdin you should pass /dev/null as file.
Calculate Median and Average of a Text FIle with Multiple Columns of Data
I have a file with multiple columns of data. I need to calculate the median and average of the two columns. Input: Desired Output: I have tried Which is good for only one column of data. Answer Here I’m assuming you meant to work with columns and calculate two sets of values. Your output format is not reflecting this assumption
BASH: how to perform arithmetic on numbers in a pipe
I am getting a stream of numbers in a pipe, and would like to perform some operations before passing them on to the next section, but I’m a little lost about how I would go about it without breaking the pipe. for example Would you have any ideas on how to make something like this work? The actual operation I