int percent (int a, int b)
{
if (b/a*100 > 25)
return TRUE;
else
return FALSE;
}
I want to calculate what percentage of a is b.
say if b = 48, a = 100
so b is 48% of a
but wouldnt b/a give me 0 ??? what can be done ?? (6 Replies)
Hi, I am having the file which contains the following two columns.
518 _factorial
256 _main
73 _atol
52 ___do_global_ctors
170 ___main
52 ___do_g
How can calculate the percentage of each value in the first column ?
first need to get the sum of the first column and... (3 Replies)
i have 3 files like
total.dat=18
equal.dat=14
notequal.dat=16
i need find the equal percentange means:
equalpercentage = ($equal.dat / $total.dat * 100)
How i can do this ?
I tried some of the answers to calculate the percentage in this forums.but it couldn't worked.Some one please... (6 Replies)
Hi
I need a awk script to calculate percentage.
I have to pass the pararmeters in to the awk script and calculate the percentage.
Sum = 50
passed = 43
failed = 7
I need to pass these value in to the awk script and calculate the percentage.
Please advice me. (8 Replies)
A short excerpt of my .txt file looks like:
CXRA3Z2J9MQKR B
CXRA3Z2J9MQKR A
CXRA3Z2J9MQKR C
CXRA3Z2J9MQKR B
A162JX4ML69UIC C
A162JX4ML69UIC A
FZ9Z19TI2XOA5 A
FZ9Z19TI2XOA5 C
FZ9Z19TI2XOA5 B
FZ9Z19TI2XOA5 B
BRNTTJUB8GXE9 A
BRNTTJUB8GXE9 A
... (7 Replies)
hello,
please can you help me.
jj and kk are two numbers which are the result of an sql program.
I would like to calculate the ratio jj/kk*100.
I have done this:
ratio=$((jj/kk * 100)) or ratio=`expr $jj \/ expr $kk) but the result is 0
What can i do?
Thanks for help. (3 Replies)
I have 100 csv files like:
file_city_1 file_city_2 file_city_3 file_city_4
City name is variable, there is 25 cities, each city has 4 region. Each of the 4 region contain some statistics like:
parameter1 : number1
parameter1 : number2
.....
parameter50 : number50
... (7 Replies)
This matrix represents correlation values.
Is it possible to calculate the percentage of columns (a1, a2, a3) that have a value >= |0.5| and report the percentage that has positive correlation >0.5 and negative correlation <-0.5 separately. thanx in advance!
input
name a1 a2 a3... (5 Replies)
Hello,
Ive got a bunch of numbers here e.g:
6065
6094
6348
6297
6161
6377
6338
6290
How do I find out if there is a difference between 10% or more between one of these numbers ? I am trying to do this in Bash.. but no luck so far.. Does anyone have an Idea ??
Thanx,
- Pascal... (9 Replies)
I have a input text file in this format:
ITEM1 10.9 20.1
ITEM2 11.6 12
ITEM3 14 15.7
ITEM5 20 50.6
ITEM6 25 23.6
I want to print those lines which have more than 5% difference between second and third columns. (8 Replies)
Discussion started by: ctrld
8 Replies
LEARN ABOUT DEBIAN
ptsematest
ptsematest(8)ptsematest(8)NAME
ptsematest - Start two threads and measure the latency of interprocess communication with POSIX mutex.
SYNTAX
ptsematest [-a|-a PROC] [-b USEC] [-d DIST] [-i INTV] [-l loops] [-p PRIO] [-t|-t NUM]
DESCRIPTION
The program ptsematest starts two threads that are synchronized via pthread_mutex_unlock()/pthread_mutex_lock() and measures the latency
between releasing and getting the lock.
OPTIONS -a, --affinity[=PROC]
Run on procesor number PROC. If PROC is not specified, run on current processor.
-b, --breaktrace=USEC
Send break trace command when latency > USEC. This is a debugging option to control the latency tracer in the realtime preemption
patch. It is useful to track down unexpected large latencies of a system.
-d, --distance=DIST
Set the distance of thread intervals in microseconds (default is 500 us). When cylictest is called with the -t option and more than
one thread is created, then this distance value is added to the interval of the threads: Interval(thread N) = Interval(thread N-1) +
DIST
-i, --interval=INTV
Set the base interval of the thread(s) in microseconds (default is 1000 us). This sets the interval of the first thread. See also
-d.
-l, --loops=LOOPS
Set the number of loops. The default is 0 (endless). This option is useful for automated tests with a given number of test cycles.
ptsematest is stopped once the number of timer intervals has been reached.
-p, --prio=PRIO
Set the priority of the process.
-t, --threads[=NUM]
Set the number of test threads (default is 1, if this option is not given). If NUM is specified, create NUM test threads. If NUM is
not specifed, NUM is set to the number of available CPUs.
EXAMPLES
The following example was running on a 4-way processor:
# ptsematest -a -t -p99 -i100 -d25 -l1000000
#0: ID8672, P99, CPU0, I100; #1: ID8673, P99, CPU0, Cycles 1000000
#2: ID8674, P98, CPU1, I125; #3: ID8675, P98, CPU1, Cycles 811035
#4: ID8676, P97, CPU2, I150; #5: ID8677, P97, CPU2, Cycles 668130
#6: ID8678, P96, CPU3, I175; #7: ID8679, P96, CPU3, Cycles 589423
#1 -> #0, Min 1, Cur 1, Avg 2, Max 11
#3 -> #2, Min 1, Cur 2, Avg 2, Max 13
#5 -> #4, Min 1, Cur 4, Avg 3, Max 12
#7 -> #6, Min 1, Cur 4, Avg 2, Max 12
AUTHORS
Carsten Emde <C.Emde@osadl.org>
SEE ALSO pthread_mutex_lock(3p), pthread_mutex_unlock(3p)
0.1 ptsematest(8)