## Linux and UNIX Man Pages

Test Your Knowledge in Computers #95
Difficulty: Easy
SMH is an Internet expression that stands for 'shake my head' or 'shaking my head'.
True or False?

# round(3) [freebsd man page]

```ROUND(3)						   BSD Library Functions Manual 						  ROUND(3)

NAME
round, roundf, roundl -- round to nearest integral value

LIBRARY
Math Library (libm, -lm)

SYNOPSIS
#include <math.h>

double
round(double x);

float
roundf(float x);

long double
roundl(long double x);

DESCRIPTION
The round(), roundf(), and roundl() functions return the nearest integral value to x; if x lies halfway between two integral values, then
these functions return the integral value with the larger absolute value (i.e., they round away from zero).

ceil(3), floor(3), ieee(3), lrint(3), lround(3), math(3), rint(3), trunc(3)

STANDARDS
These functions conform to ISO/IEC 9899:1999 (``ISO C99'').

HISTORY
The round() and roundf() functions appeared in FreeBSD 5.3.  The roundl() function appeared in FreeBSD 6.0.

BSD								   April 7, 2005							       BSD```

## how to round a value

Hello, In a unix shell script,i want to round a variabele to a nearest number Ex: set count=104.4 How can i round that to 105.? Thanks, Sateesh

## round in KSH

Is there an easy way to round a number up in Korn shell? ie. 10.4 --> 11 Thanks.

## round a number

In a shell script - How do I round a decimal number (contained in a variable) to the nearest whole number?

## Help In Awk

Hi Friends, I need a help again in awk. I just need to round up a value. Eg Say x=5.664584525 I need to display x=5.66 means round. How can i do round in UNIX.

## How to round up on fives in unix?

i'm a newbie here, i need help with a shell script. for a given number, if it is greater than ten round to the nearest 10 same for 100, if it is greater than 100 round to the nearest 100, and same for 1000. i'm confused how to start this... its supposed to look like this input ...

## round decimal values and use in loops

i have a file in which 3 values are stored like --4.72 4.42 3.86 what i wanna do is that take read each value and compare with a fixed value say 5 but cant do so as i am getting an error for the same. please check the code cat /home/nsadm/auto/Logging/uptime.txt| while read a b c do if...

## Using sed to round a number

Hey everyone, I was wondering if i am able to write a sed command to round a number to two decimal places. So for example: 1.58674 would be 1.58 I just want to chop off the numbers to the right of the second digit after the period. I know this is probably trivial but the closest i got was...

## Rounding up to nearest whole number

Hi all of you, Would be great if you help me with how to round up to whole number from my input values like 2.99996,2.17890,3.00002,-2.3456,-2.7890 o/p should be like 3,2,3,-2,-3 thnks in adv!!!! regards