## Linux and UNIX Man Pages

Test Your Knowledge in Computers #265
Difficulty: Easy
Alan Turing was prosecuted by the UK in 1952 for homosexual acts.
True or False?

# roundf(3m) [opensolaris man page]

```round(3M)						  Mathematical Library Functions						 round(3M)

NAME
round, roundf, roundl - round to nearest integer value in floating-point format

SYNOPSIS
c99 [ flag... ] file... -lm [ library... ]
#include <math.h>

double round(double x);

float roundf(float x);

long double roundl(long double x);

DESCRIPTION
These  functions round their argument to the nearest integer value in floating-point format, rounding halfway cases away from 0, regardless
of the current rounding direction.

RETURN VALUES
Upon successful completion, these functions return the rounded integer value.

If x is NaN, a NaN is returned.

If x is +-0 or +- Inf, x is returned.

ATTRIBUTES
See attributes(5) for descriptions of the following attributes:

+-----------------------------+-----------------------------+
|      ATTRIBUTE TYPE	     |	    ATTRIBUTE VALUE	   |
+-----------------------------+-----------------------------+
|Interface Stability	     |Standard			   |
+-----------------------------+-----------------------------+
|MT-Level		     |MT-Safe			   |
+-----------------------------+-----------------------------+

SunOS 5.11							    12 Jul 2006 							 round(3M)```

## Check Out this Related Man Page

```round(3M)						  Mathematical Library Functions						 round(3M)

NAME
round, roundf, roundl - round to nearest integer value in floating-point format

SYNOPSIS
cc [ flag... ] file... -lm [ library... ]
#include <math.h>

double round(double x);

float roundf(float x);

long double roundl(long double x);

DESCRIPTION
These  functions round their argument to the nearest integer value in floating-point format, rounding halfway cases away from 0, regardless
of the current rounding direction.

RETURN VALUES
Upon successful completion, these functions return the rounded integer value.

If x is NaN, a NaN is returned.

If x is +-0 or +- Inf, x is returned.

ATTRIBUTES
See attributes(5) for descriptions of the following attributes:

+-----------------------------+-----------------------------+
|      ATTRIBUTE TYPE	     |	    ATTRIBUTE VALUE	   |
+-----------------------------+-----------------------------+
|Interface Stability	     |Standard			   |
+-----------------------------+-----------------------------+
|MT-Level		     |MT-Safe			   |
+-----------------------------+-----------------------------+

SunOS 5.10							    1 Nov 2003								 round(3M)```

## 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.

## Rouding off an integer

HI I want to round off an integer to the next multiple of 10 in shell script. (i.e.,) 91 should be rounded off to 100 and 90 should be rounded off to 90 It would be very helpful, if you can help me in this. Thanks in advance

## 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 ...

## 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

## Rounding decimal values in a column

Hi, I wanted to round all the values in a column to nearest integer. I have multiple files with only two columns and I want to round values in column 2. e.g input_file A1 23.971578 A2 34.624976 A3 46.403446 A4 375 A5 1 A6 3 A7 ...