Hello,
I searched a lot on this Forum.
Please help me with the below problem.
I want to divide two numbers and the result should be the next nearest whole number.
E.G. Dividing 10.8/5 ideally gives 2.16. But the result should be 3 i.e. rounded off to the next whole number.
Any help will... (2 Replies)
Hi,
I'm trying to find the nearest match between two columns of numbers, e.g.
1,1
10,8
30,50
20,100
and the search could be e.g. 20,20
returning 10,8 - i.e. 20-10 = 10 and 20-8 = 12 totalling 22, and hence being the nearest match.
any ideas?
thanks a lot, (1 Reply)
Hi Guys,
I am generating a statistical report , below is the snippet of the code :
Now, $nSlices stands for the time duration,meaning,the statistics will be displayed for that particular time duration. Trouble is, for certain values of $totalTime (which is the end time - start time ), i... (9 Replies)
Hello Guys,
I'm very new on here and require some help matching up and printing some columns using awk.
I have two text files. The first file has Longitude data in column 1 (lon.txt) and the second one (node.txt) has again another Longitude data in column 1 (not exact as the first one) + in... (7 Replies)
Dear Experts,
I'm trying to find a way to round a number but in this way:
14367.577 ---> 14000
I used the following to round the number to the closer integer:
echo $var|awk '{print int($1+0.5)}'
and also:
xargs printf "%1.0f"
However, they don't work for my above... (9 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:#include <stdio.h>
#define GTAX 0.06
#define STAX 0.10
int main(void)
{
int C_sets;
double Price_C;
... (1 Reply)
I have a number, which I want to convert into the nearest floating number upto two places after the decimal point.
E.g.
1.2346 will become 1.23
but
1.2356 will become 1.24 .
Similarly
0.009 will be 0.01
and
0.001 will be 0.00 or 0.0 (not 0, wnat to keep the decimal... (1 Reply)
Heyas
Trying to calculate the total size of a file by reading its bitrate.
Code snippet:
fs_expected() { #
# Returns the expected filesize in bytes
#
pr_str() {
ff=$(cat $TMP.info)
d="${ff#*bitrate: }"
echo "${d%%,*}" | $AWK '{print $1}' | head -n 1
}
t_BYTERATE=$((... (9 Replies)
Hello,
I have a file with below content - Example
3
6
69
139
210
345
395
418
490
492
I would like the result as - Multiple of 70 or nearest number in the file less than the multiple of 70
69
139 (5 Replies)
Discussion started by: Mannu2525
5 Replies
LEARN ABOUT HPUX
roundw
round(3M)round(3M)NAME
round(), roundf(), roundl(), roundw(), roundq() - round functions
SYNOPSIS
HP Integrity Server Only
DESCRIPTION
The function rounds its argument to the nearest integral value in floating-point format. An argument exactly halfway between two integers
is rounded away from zero, regardless of the current rounding direction. Rounding away from zero also applies to the functions, and
Integrity Server Only
is a version of it takes a argument and returns a result.
is a version of it takes a argument and returns a result.
is an version of it takes an argument and returns an result.
is equivalent to on HP-UX systems.
USAGE
To use these functions, compile either with the default option or with the and options.
To use (for Integrity servers) or compile also with the option.
To use these functions, make sure your program includes Link in the math library by specifying on the compiler or linker command line.
For more information, see the at the following site:
RETURN VALUE
If x is returns x.
If x is NaN, returns NaN.
may raise the inexact exception if x is non integral and finite.
ERRORS
No errors are defined.
SEE ALSO ceil(3M), floor(3M), fabs(3M), fmod(3M), fegetround(3M), fesetround(3M), lrint(3M), llrint(3M), lround(3M), llround(3M), rint(3M),
trunc(3M), math(5), fenv(5).
STANDARDS CONFORMANCE
: ISO/IEC C99 (including Annex F, ``IEC 60559 floating-point arithmetic'')
round(3M)