Sponsored Content
Full Discussion: adding float numbers
Top Forums Shell Programming and Scripting adding float numbers Post 71376 by strike on Tuesday 10th of May 2005 11:43:54 AM
Old 05-10-2005
thanks for that
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Adding 2 numbers

I would like to write a script with BASH to add two numbers (integer) and write the result to the standard output. Please help! (7 Replies)
Discussion started by: Viper01
7 Replies

2. Programming

math.h: float ceilf(float x)

Good morning, I'm testing the use of ceilf: /*Filename: str.c*/ #include <stdio.h> #include <math.h> int main (void) { float ceilf(float x); int dev=3, result=0; float tmp = 3.444f; printf("Result: %f\n",ceilf(tmp)); return 0; } (1 Reply)
Discussion started by: jonas.gabriel
1 Replies

3. Solaris

i cannot assign float point numbers to an array in solaris

total=0 declare -a sum limit=`iostat -En | grep -i size | awk '{print $2}' | sed -e 's/GB//g' | wc -l` echo "Limit is equal to $limit" ara="`iostat -En | grep -i size | awk '{print $2}' | sed -e 's/GB//g'`" for (( i=1; i<=$limit; i++ )) do sum=`echo $ara | cut -d " " -f $i` echo ${sum}... (11 Replies)
Discussion started by: naree
11 Replies

4. Solaris

can array store float point numbers

Hi all, I have doubt can array in a shell script can store floating point numbers. i have tired. but i unable to work it out. Please help me regarding this Thank U Naree (1 Reply)
Discussion started by: naree
1 Replies

5. Programming

comparison between float numbers

Hi, i have a simple control like this: if(sum>1.0)... If i try to print sum i get 1.000000 but the check returns true. I think it depends on float precision. How can i modify the check? thanks (1 Reply)
Discussion started by: littleboyblu
1 Replies

6. Shell Programming and Scripting

Random float numbers in BASH

Hi people :) I'm learning shell scripting using bash and I want to generate 4 floating point number with 5 decimal places and write them to a file and a variable. I've done all this except the $RAMDOM enviroment variable does not generate a float number but a integrer. I hope you could... (3 Replies)
Discussion started by: pharaoh
3 Replies

7. Shell Programming and Scripting

help with adding up numbers

I have a file which has following contents which I want to add up. 28170.24 28170.24 28170.24 28170.24 28170.24 28170.24 28170.24 28170.24 28170.24 28170.24 28170.24 28170.24 28170.24 28170.24 139038.72 139038.72 139038.72 139038.72 (5 Replies)
Discussion started by: aksijain
5 Replies

8. Shell Programming and Scripting

Adding (as in arithmetic) to numbers in columns in file, and writing new file with new numbers

Hi again. Sorry for all the questions — I've tried to do all this myself but I'm just not good enough yet, and the help I've received so far from bartus11 has been absolutely invaluable. Hopefully this will be the last bit of file manipulation I need to do. I have a file which is formatted as... (4 Replies)
Discussion started by: crunchgargoyle
4 Replies

9. Shell Programming and Scripting

Help about using variables of float numbers in sed

Hi, I need to run a Fortran program which reads a input file with a fixed name many times, each time I need to change a number (real) in that input file, this is how I currently do it and I know it is not elegent at all: cp inputfile.dat backup.dat sed -i 's/28.0/0.01/g' inputfile.dat ./myCode... (3 Replies)
Discussion started by: dypang
3 Replies
complex(3)						     Library Functions Manual							complex(3)

NAME
csin, ccos, cdiv, cexp, clog, cmul, cpow, csqrt - Complex functions LIBRARY
Math Library (libm.a) SYNOPSIS
#include <math.h> double_complex csin (double x, double y); float_complex csinf (float x, float y); double_complex ccos (double x, double y); float_complex ccosf (float x, float y); double_complex cdiv (double a, double b, double c, double d); float_complex cdivf (float a, float b, float c, float d); double_complex cexp (double x, double y); float_complex cexpf (float x, float y); double_complex clog (double x, double y); float_complex clogf (float x, float y); double_complex cmul (double a, double b, double c, double d); float_complex cmulf (float a, float b, float c, float d); double_complex cpow (double a, double b, double c, double d); float_complex cpowf (float a, float b, float c, float d); double_complex csqrt (double x, double y); float_complex csqrtf (float x, float y); DESCRIPTION
These functions can only be called from languages that support the double_complex and float_complex data types. csin() and csinf() compute the sine of a complex number. ccos() and ccosf() return the cosine of a complex number. cdiv() and cdivf() return the quotient of two complex numbers: (a+ib)/(c+id). cexp() and cexpf() return the exponential of a complex number. clog() and clogf() return the natural logarithm of a complex number. cmul() and cmulf() return the product of two complex numbers. cmul(a,b,c,d) is equivalent to (a + ib) * (c + id). cpow() and cpowf() raise a complex base (a + ib) to a complex exponent (c + id). cpow(a,b,c,d) is equivalent to e**((c + id) ln(a + ib)). csqrt() and csqrtf() compute the square root of a complex number, x + iy. The real part of csqrt is greater than or equal to zero. --------------------------------------------------------------------------- Function Exceptional Argument Routine Behavior --------------------------------------------------------------------------- csin(), csinf() |y| = infinity invalid argument csin(), csinf() (sinh x sin y) > max_float overflow csin(), csinf() (cosh x cos y) > max_float overflow ccos(), ccosf() |y| = infinity invalid argument ccos(), ccosf() (sin x sinh y) > max_float overflow ccos(), ccosf() (cos x cosh y) > max_float overflow cdiv(), cdivf() c=0 and d=0 divide by zero cdiv(), cdivf() a=b=c=d=0 invalid argument cexp(), cexpf() |y| = infinity invalid argument cexp(), cexpf() |e**x cos y| > max_float overflow cexp(), cexpf() |e**x sin y| > max_float overflow cexp(), cexpf() |e**x cos y| < min_float underflow cexp(), cexpf() |e**x sin y| < min_float underflow clog(), clogf() y=0 and x=0 invalid argument clog(), clogf() |x| = |y| = infinity invalid argument cpow(), cpowf() sqrt(a**2 + b**2) > max_float overflow cpow(), cpowf() c/2 * ln(a**2 + b**2) > max_float overflow cpow(), cpowf() c/2 * ln(a**2 + b**2) overflow - (d * atan2(b,c)) > max_float --------------------------------------------------------------------------- ----------------------------------------------------------------------------- Value Data Hexadecimal Value Decimal Value Name Type ----------------------------------------------------------------------------- max_float F_FLOAT FFFF7FFF 1.701411e38 G_FLOAT FFFFFFFFFFFF7FFF 8.988465674311579e307 S_FLOAT 7F7FFFFF 3.402823e38 T_FLOAT 7FEFFFFFFFFFFFFF 1.797693134862316e308 min_float F_FLOAT 00000080 2.9387359e-39 G_FLOAT 0000000000000010 5.562684646268003e-309 S_FLOAT 00000001 1.4012985e-45 T_FLOAT 0000000000000001 4.940656458412465e-324 ----------------------------------------------------------------------------- RELATED INFORMATION
cabs(3) delim off complex(3)
All times are GMT -4. The time now is 10:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy