Visit The New, Modern Unix Linux Community

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?
Linux & Unix Commands - Search Man Pages

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). SEE ALSO
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

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

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 (2 Replies)
Discussion started by: kotasateesh
2 Replies

2. Shell Programming and Scripting

round in KSH

Is there an easy way to round a number up in Korn shell? ie. 10.4 --> 11 Thanks. (6 Replies)
Discussion started by: here2learn
6 Replies

3. Shell Programming and Scripting

round a number

In a shell script - How do I round a decimal number (contained in a variable) to the nearest whole number? (2 Replies)
Discussion started by: achieve
2 Replies

4. UNIX for Advanced & Expert Users

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. (6 Replies)
Discussion started by: Soumya Dash
6 Replies

5. Shell Programming and Scripting

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 ... (11 Replies)
Discussion started by: CRAZYLITTLELOU
11 Replies

6. Shell Programming and Scripting

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... (2 Replies)
Discussion started by: gemnian.g
2 Replies

7. Shell Programming and Scripting

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... (8 Replies)
Discussion started by: GmGeubt
8 Replies

8. UNIX for Dummies Questions & Answers

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 (3 Replies)
Discussion started by: Indra2011
3 Replies

Featured Tech Videos