Skip to content
Advertisement

Tag: math

NASM division using variables instead of actual values

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

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.

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

Advertisement