Oh I see the problem. $1 and $2 are local to functions but you are not passing parameters to the function. Perhaps define a and b outside of the functions, e.g...
Guys,
I have two big numbers to multiply. In doing do I am getting integer overflow.
I managed to multiply number but this number is useless as KSh does not recognise it as
a valid number. Here is what I am doing
$ expr 999999999999 \* 100
276447132
I got the right value by doing... (2 Replies)
Hi,
I have a shell scripting. This will take 7 digit number in each line and add 7 digit number with next subsequent lines ( normal addition ).
Eg:
0000001
0000220
0001235
0000022
0000023
...........
.........
........
Like this i am having around 1500000 records. After adding... (23 Replies)
hi, i am trying some awk arthmatic calculation,i have a problem if any one can help
let say if i have a file
exm.txt
3 + 2
3 * 2
3 / 2
3 - 2
the output expected is
awk -f exm.awk exm.txt
3 + 2 = 5
3 * 2 = 6
3 / 2 = 1.5
3 - 2 = 1
i simply used exm.awk
{
print $1 " + " $3 "= " $1 +... (3 Replies)
Hi Everyone!
I'm trying to do simple math on a single command line instead of a script which I've already set up using let etc. I can not get the same output to display on a command line.
Essentially I would like a=20, b=50, and c=a*b.
When I tried:
let "A=20, B=50"; let C=A*B; echo $C
... (2 Replies)
I have a file with the following content.
> cat /tmp/internetusage.txt
6709.296322 30000 2/7/2010 0.00I am using the following awk command to calculate a percentage from field 1 and 2 from the file.
awk '{ print $1/$2*100 }' /tmp/internetusage.txt
This outputs the value "22.3643" as a... (1 Reply)
Discussion started by: jelloir
1 Replies
LEARN ABOUT SUNOS
mlib_imagemoment2_fp
mlib_ImageMoment2_Fp(3MLIB) mediaLib Library Functions mlib_ImageMoment2_Fp(3MLIB)NAME
mlib_ImageMoment2_Fp - second moment
SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ]
#include <mlib.h>
mlib_status mlib_ImageMoment2_Fp(mlib_d64 *moment, const mlib_image *img);
DESCRIPTION
The mlib_ImageMoment2_Fp() function computes the second moment of each channel in a floating-point image.
It uses the following equation:
1 w-1 h-1
moment[i] = ----- * SUM SUM img[x][y][i]**2
w*h x=0 y=0
PARAMETERS
The function takes the following arguments:
moment Pointer to moment array, where length is the number of channels in the image.
img Pointer to an image.
RETURN VALUES
The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO mlib_ImageMoment2(3MLIB), attributes(5)SunOS 5.10 10 Nov 2004 mlib_ImageMoment2_Fp(3MLIB)