Sponsored Content
Full Discussion: Math function with C
Top Forums Programming Math function with C Post 302722247 by Fingerz on Friday 26th of October 2012 02:34:49 PM
Old 10-26-2012
printf

printf("\nA marathon is %f kilometers.\n\n", kilometers);
 

9 More Discussions You Might Find Interesting

1. Programming

math.h not working? o.0

Alright, umm i cant get this to work. im looking at some example and a book i have. when i try to compile my program i get an error message. ld: 0711-317 ERROR: Undefined symbol: .sqrt ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. I did #include<math.h> after my... (2 Replies)
Discussion started by: primal
2 Replies

2. Programming

something about <math.h>

Hi, I got an easy problem for you but really difficult for me 'cause I am pretty new to this field I got header file <math.h> included in my .c file , then I write the code as below: k = sqrt(i); /* both variables k and i are int */ then I cc temp.c it says like this undefined... (4 Replies)
Discussion started by: blf0
4 Replies

3. Programming

some math problems in C

I want to calculate secant method using C language That is a program----> #include<stdio.h> #include<math.h> #include<stdlib.h> main() { double fx(double x); double x0,x1,x2,f0,f1,f2,err; int n,i; printf("\n\n f(x) =x*x*x-5*x-7"); printf("\n\nEnter an interval in" ... (4 Replies)
Discussion started by: cdfd123
4 Replies

4. Programming

math.h in makefile

Hey all, How do I link the math library in a gnu make makefile? I have tried using -lm with the CFLAGS varibale - flags like -Wall and -ggdb work, but -lm does not. I am running gcc - 4.1.2 on a linux machine. (2 Replies)
Discussion started by: kermit
2 Replies

5. UNIX for Dummies Questions & Answers

math in unix

I have 2 variables a=2 b=1 i want to add a and b how do i do this in unix using just the echo command and by assigning it to a different variable like c? (13 Replies)
Discussion started by: khestoi
13 Replies

6. Shell Programming and Scripting

math help

$ x=1 $ y=1.5 $ z=$((x*y)) bash: 1.5: syntax error: invalid arithmetic operator (error token is ".5") What's wrong? (2 Replies)
Discussion started by: rockbike
2 Replies

7. Shell Programming and Scripting

Need help with AWK math

I am trying to do some math, so that I can compare the average of six numbers to a variable. Here is what it looks like (note that when I divide really big numbers, it isn't a real number): $ tail -n 6 named.stats | awk -F\, '{print$1}' 1141804 1140566 1139429 1134210 1084682 895045... (3 Replies)
Discussion started by: brianjb
3 Replies

8. UNIX for Dummies Questions & Answers

Linux Math Help

I am struggling with scripting this challenge a friend and I have. You have file1 and its contents is a single number you have file 2 and its contents are a different number you want to add file1 to file2 and have the output be put into file3 (3 Replies)
Discussion started by: minkyboodle
3 Replies

9. UNIX for Dummies Questions & Answers

Math

i have file (my_file.txt) that looks like this: 000000000000010000 000000000000010000 000000000000005000 000000000000005000 000000000000005000 000000000000005000 000000000000005000 000000000000005000 000000000000005000 000000000000005000 all said and one, it should look... (11 Replies)
Discussion started by: lawsongeek
11 Replies
GRDFILTER(l)															      GRDFILTER(l)

NAME
grdfilter - Filter a .grd file in the Time domain SYNOPSIS
grdfilter input_file.grd -Dflag -F<type><width> -Goutput_file.grd [ -Ix_inc[m|c][/y_inc[m|c]] ] [ -Rwest/east/south/north[r] ] [ -T ] [ -V ] DESCRIPTION
grdfilter will filter a .grd file in the time domain using a boxcar, cosine arch, gaussian, median, or mode filter and computing distances using Cartesian or Spherical geometries. The output .grd file can optionally be generated as a sub-Region of the input and/or with a new -Increment. In this way, one may have "extra space" in the input data so that the edges will not be used and the output can be within one- half- width of the input edges. If the filter is low-pass, then the output may be less frequently sampled than the input. input_file.grd The file of points to be filtered. -D Distance flag tells how grid (x,y) relates to filter width as follows: flag = 0: grid (x,y) same units as width, Cartesian distances. flag = 1: grid (x,y) in degrees, width in kilometers, Cartesian distances. flag = 2: grid (x,y) in degrees, width in km, dx scaled by cos(middle y), Cartesian distances. The above options are fastest because they allow weight matrix to be computed only once. The next two options are slower because they recompute weights for each East-West scan line. flag = 3: grid (x,y) in degrees, width in km, dx scaled by cosine(y), Cartesian distance calculation. flag = 4: grid (x,y) in degrees, width in km, Spherical distance calculation. -F Choose one only of bcgmp for (b)oxcar, (c)osine Arch, (g)aussian, (m)edian, or maximum likelihood (p)robability (a mode estimator) filter and specify full width. -G output_file.grd is the output of the filter. OPTIONS
-I x_inc [and optionally y_inc] is the output Increment. Append m to indicate minutes, or c to indicate seconds. If the new x_inc, y_inc are NOT integer multiples of the old ones (in the input data), filtering will be considerably slower. [Default: Same as input.] -R west, east, south, and north defines the Region of the output points. [Default: Same as input.] -T Toggle the node registration for the output grid so as to become the opposite of the input grid [Default gives the same registration as the input grid]. -V Selects verbose mode, which will send progress reports to stderr [Default runs "silently"]. EXAMPLES
Suppose that north_pacific_dbdb5.grd is a file of 5 minute bathymetry from 140E to 260E and 0N to 50N, and you want to find the medians of values within a 300km radius (600km full width) of the output points, which you choose to be from 150E to 250E and 10N to 40N, and you want the output values every 0.5 degree. Using spherical distance calculations, you need: grdfilter north_pacific_dbdb5.grd -Gfiltered_pacific.grd -Fm600 -D4 -R150/250/10/40 -I0.5 -V SEE ALSO
gmt(1gmt), grdfft(1gmt) 1 Jan 2004 GRDFILTER(l)
All times are GMT -4. The time now is 08:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy