This doesn't work with Solaris' Bourne shell (/bin/sh)
It works with any Posix shell (so /usr/xpg4/bin/sh on Solaris).
But this should just work in Bourne shell as well, shouldn't it? Did you try?
-----
edit: Ah, I see you did not mean the loop but the second part: because of the $() .
Then you can use:
Last edited by Scrutinizer; 11-10-2010 at 11:02 AM..
Hi Gurus,
In my file I have an amount field from position 74 to 87, which contains values starting with '+' as well as '-'. I want to add all positive values in a varible called "CREDIT" and all negative values in a variable "DEBIT". I know, we can use grep to identify values with positive and... (4 Replies)
Hello,
For my weather station I have made a little perl script to put the data into cacti. The next problem I have.
I can only get positive numbers or negative numbers.
What do I do:
Though a shell scrip I call the perl script.
Shell script:
#!/bin/sh
cat data.txt | stats.pl
Perl... (4 Replies)
Hi,
I have a file that looks like this:
Jake 2 3 4 6 4 3 -2 -1
Jerry 1 2 3 2 1 7 -6 -1
Timmy -1 -4 -5 -8 9 3 1
I want to find the most positive and negative value for each row and also define its position (based on column #)
So the output would look... (7 Replies)
Hello,
I have a list like this :
1
2
-4
0
-3
-7
5
6 etc.
Is there a way to remove all the positive values and print only the negative values, without using grep, sed or awk?
Thanks,
Prasanna (4 Replies)
Hi all,
I have a file that looks like shown below. I want to find places where the value in column 2 change from negative to positive and vice versa and return the value on column 1 at that point. I wonder if this is possible in shell script or awk .. please help!
Here is the original data
... (6 Replies)
Hello all,
I'm new to the forums and hope to be able to contribute something useful in the future; however I must admit that what has prompted me to join is the fact that currently I need help with something that has me at the end of my tether.
I have a PDB (Protein Data Bank) file which I... (13 Replies)
Dear All,
I have to split a tab delimited file in two files based on the presence of a positive or negative in column number 9 , for example
file:
A 1 5 erg + 6766 0.9889 0.9817 9.01882 erg inside upstream
B 1 8 erg2 + 6766 0.9889 0.9817 -9.22 erg2 inside... (3 Replies)
Hi ALL,
I am having semi column separated file as below. I am having negative values for the records starting with 11095. How can I convert that positive number
I tried this below seems not working
sed 's/ \(*\)$/ -\1/;t;s/\(.*\)-/\1/ myfile
myfile... (6 Replies)
I have a file that is pipe delimited and in Column F they have number values, both positive and negative. I need to take the one file I am starting with and split it into two separate files based on negative and positive numbers. What is the command to do so? And then I need to also transfer... (4 Replies)
Discussion started by: cckaiser15
4 Replies
LEARN ABOUT SUSE
complex
COMPLEX(7) Linux Programmer's Manual COMPLEX(7)NAME
complex - basics of complex mathematics
SYNOPSIS
#include <complex.h>
DESCRIPTION
Complex numbers are numbers of the form z = a+b*i, where a and b are real numbers and i = sqrt(-1), so that i*i = -1.
There are other ways to represent that number. The pair (a,b) of real numbers may be viewed as a point in the plane, given by X- and Y-
coordinates. This same point may also be described by giving the pair of real numbers (r,phi), where r is the distance to the origin O,
and phi the angle between the X-axis and the line Oz. Now z = r*exp(i*phi) = r*(cos(phi)+i*sin(phi)).
The basic operations are defined on z = a+b*i and w = c+d*i as:
addition: z+w = (a+c) + (b+d)*i
multiplication: z*w = (a*c - b*d) + (a*d + b*c)*i
division: z/w = ((a*c + b*d)/(c*c + d*d)) + ((b*c - a*d)/(c*c + d*d))*i
Nearly all math function have a complex counterpart but there are some complex-only functions.
EXAMPLE
Your C-compiler can work with complex numbers if it supports the C99 standard. Link with -lm. The imaginary unit is represented by I.
/* check that exp(i * pi) == -1 */
#include <math.h> /* for atan */
#include <stdio.h>
#include <complex.h>
int
main(void)
{
double pi = 4 * atan(1.0);
double complex z = cexp(I * pi);
printf("%f + %f * i
", creal(z), cimag(z));
}
SEE ALSO cabs(3), carg(3), cexp(3), cimag(3), creal(3)COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
2009-07-25 COMPLEX(7)