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)
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)
Hi all,
I have a tab-delimited text file in which i have a few columns which look like,
X Y U V
2 3 4 5
4 5 3 4
6 4 3 2
For example, I want to calculate the ratio (X+Y)/(X+Y+U+V) for each row and print the output.
X Y U V ... (3 Replies)
Need an awk script to calculate the percentage of value field and replace
I have a input file called file.txt with the following content:
john|622.5674603562933|8|br:1;cn:3;fr:1;jp:1;us:2
andy|0.0|12|**:3;br:1;ca:2;de:2;dz:1;fr:2;nl:1
in fourth filed of input file, calulate percentage of each... (1 Reply)
I have a input file called file.txt with the following content:
john|622.5674603562933|8|br:1;cn:3;fr:1;jp:1;us:2
andy|0.0|12|**:3;br:1;ca:2;de:2;dz:1;fr:2;nl:1
in fourth filed of input file, calulate percentage of each sub filed seperated by ; semicolon and replace value with percentage .
i... (11 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)
How can i convert two columns in to o and 1 matrix. thnks
Input
a c1
b c2
c c1
d c3
e c4
output
c1 c2 c3 c4
a 1 0 0 0
b 0 1 0 0
c 1 0 0 0
d 0 0 ... (5 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 REDHAT
slasq2
SLASQ2(l) ) SLASQ2(l)
NAME
SLASQ2 - compute all the eigenvalues of the symmetric positive definite tridiagonal matrix associated with the qd array Z to high relative
accuracy are computed to high relative accuracy, in the absence of denormalization, underflow and overflow
SYNOPSIS
SUBROUTINE SLASQ2( N, Z, INFO )
INTEGER INFO, N
REAL Z( * )
PURPOSE
SLASQ2 computes all the eigenvalues of the symmetric positive definite tridiagonal matrix associated with the qd array Z to high relative
accuracy are computed to high relative accuracy, in the absence of denormalization, underflow and overflow. To see the relation of Z to
the tridiagonal matrix, let L be a unit lower bidiagonal matrix with subdiagonals Z(2,4,6,,..) and let U be an upper bidiagonal matrix with
1's above and diagonal Z(1,3,5,,..). The tridiagonal is L*U or, if you prefer, the symmetric tridiagonal to which it is similar.
Note : SLASQ2 defines a logical variable, IEEE, which is true on machines which follow ieee-754 floating-point standard in their handling
of infinities and NaNs, and false otherwise. This variable is passed to SLASQ3.
ARGUMENTS
N (input) INTEGER
The number of rows and columns in the matrix. N >= 0.
Z (workspace) REAL array, dimension ( 4*N )
On entry Z holds the qd array. On exit, entries 1 to N hold the eigenvalues in decreasing order, Z( 2*N+1 ) holds the trace, and Z(
2*N+2 ) holds the sum of the eigenvalues. If N > 2, then Z( 2*N+3 ) holds the iteration count, Z( 2*N+4 ) holds NDIVS/NIN^2, and Z(
2*N+5 ) holds the percentage of shifts that failed.
INFO (output) INTEGER
= 0: successful exit
< 0: if the i-th argument is a scalar and had an illegal value, then INFO = -i, if the i-th argument is an array and the j-entry had
an illegal value, then INFO = -(i*100+j) > 0: the algorithm failed = 1, a split was marked by a positive value in E = 2, current
block of Z not diagonalized after 30*N iterations (in inner while loop) = 3, termination criterion of outer while loop not met (pro-
gram created more than N unreduced blocks)
FURTHER DETAILS
The shifts are accumulated in SIGMA. Iteration count is in ITER. Ping-pong is controlled by PP (alternates between 0 and 1).
LAPACK version 3.0 15 June 2000 SLASQ2(l)