Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

trunc(3m) [hpux man page]

trunc(3M)																 trunc(3M)

NAME
trunc(), truncf(), truncl(), truncw(), truncq() - truncation functions SYNOPSIS
HP Integrity Server Only DESCRIPTION
The function rounds its argument to the integral value, in floating-point format, nearest to but no larger in magnitude than the argument. 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), round(3M), math(5), fenv(5). STANDARDS CONFORMANCE
: ISO/IEC C99 (including Annex F, ``IEC 60559 floating-point arithmetic'') trunc(3M)

Check Out this Related Man Page

rint(3M)																  rint(3M)

NAME
rint(), rintf(), rintl(), rintw(), rintq(), nearbyint(), nearbyintf(), nearbyintl(), nearbyintw(), nearbyintq() - round to nearest integer functions SYNOPSIS
HP Integrity Server Only DESCRIPTION
and return the integer (represented as a floating-point number) nearest x according to the current rounding direction mode. These func- tions meet the requirement of the IEEE-754 standard for an operation that rounds to integer in floating-point format. The two functions are identical except that raises the inexact exception if the result differs in value from the argument, while does not. In the default rounding direction (round to nearest), is the integer nearest x with the additional stipulation that if |-x|=1/2, then is even. (The same statement applies to If the current rounding direction is toward negative infinity, and return the same value as If the current rounding direction is toward positive infinity, and return the same value as Integrity Server Only are versions of and respectively; they take a argument and return a result. and are versions of and respectively; they take a argument and return a result. and are versions of and respectively; they take an argument and return an result. and are equivalent to and respectively 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 with the option. 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 and return x. If x is NaN, the and functions return NaN. 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), round(3M), trunc(3M), math(5), fenv(5). STANDARDS CONFORMANCE
: XPG4.2, ISO/IEC C99 (including Annex F, ``IEC 60559 floating-point arithmetic'') : ISO/IEC C99 (including Annex F, ``IEC 60559 floating-point arithmetic'') rint(3M)
Man Page

14 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

`ps` command truncating text

I have some processes that show a long file path as part of the process name and the process name gets truncated off. Does anyone know how to get the full output from the `ps`command so that I can see the whole process name? (9 Replies)
Discussion started by: keelba
9 Replies

2. Solaris

ps truncated output

Hi Problem of ps on Solaris 8 and 9 Perhaps a silly question but I can't find a solution. the output of the command ps -ef is truncated. I've tried to change the terminal settings with stty putting a big number of colums: no change. Following the man page of ps i have set the variable... (8 Replies)
Discussion started by: renoc
8 Replies

3. UNIX for Advanced & Expert Users

What is the cause of file truncation?

Hi, I have a program that gets called from the front end of my application. Actually it creates some temporary files and uses them and deletes them at last. But sometimes, say once in 6 times, some of these temporary files are getting truncated in the middle and because of this my program is... (9 Replies)
Discussion started by: venkatmyname
9 Replies

4. Shell Programming and Scripting

Loop through and truncate tables

Hi, I was working on the truncate oracle table shell script. The script is supplied with one table name as a parameter and I would like to change it so that it is passed a file name with a list of tables. And the script needs to truncate tables one by one by looping through the file. In other... (10 Replies)
Discussion started by: madhunk
10 Replies

5. Shell Programming and Scripting

Truncate multiple file extensions

Hi, I have files with names like file1.txt.txt.txt.txt and file2.txt.txt.txt.txt.txt............ (random infinite number of .txt exist). how to truncate (mv) their names to ones with single .txt extension like file1.txt and file1.txt ? In other words, how to extract the filename upto first... (12 Replies)
Discussion started by: prvnrk
12 Replies

6. UNIX for Dummies Questions & Answers

How can i truncate filenmes?

I am using FC6 just in case it matters, though i hope it doesn't. If i have a file or some files that i want to truncate the filename of, so that it is only a certain number of characters in length, how would i do that on the command line? Also, just to make it more interesting, say i... (11 Replies)
Discussion started by: Calum
11 Replies

7. UNIX for Dummies Questions & Answers

how to run cron job to truncate database table

hi i'm a bit stuck trying to find the correct syntax in order to run a cron job which just truncates all info from a single table in my database i have a main database - db1 and i have a table in that database - userips i wish to create a cron job that truncates or removes all the info... (9 Replies)
Discussion started by: wingchun22
9 Replies

8. Shell Programming and Scripting

Truncate file name to 40 characters

Hello all. I would like to make a script (or two shell scripts) that will do the following. I need the maximum file name and directory name to be 38 characters long. As well, if shortening the file name ends up making all of the files in that directory have the same name, then I would like... (9 Replies)
Discussion started by: marcozd
9 Replies

9. Solaris

"Processes" truncated on Solaris

ps -eo pid,ppid,uid,user,args If i use above command on any of my sol boxes,i see that fifth column (args or COMMAND) is truncated. Is there a way of getting full details in this column ,like we have in AIX? Regards Abhi (13 Replies)
Discussion started by: ak835
13 Replies

10. Shell Programming and Scripting

Truncate path and keep only filenames

Hi everyone, I have a question for you, I'm trying to create a script that will automate creating loading screens for the iPhone. So what I need to do, is list the directories inside /var/mobile/Applications and scan inside those, for the .app directory inside each. Take that .app name... (15 Replies)
Discussion started by: kicker75
15 Replies

11. Shell Programming and Scripting

How to truncate a string to x number characters?

Hello: I have a large file which contains lines like the following: 1/t123ab, &Xx:1:1234:12345:123456@ABCDEFG... at -$100.00% /t is a tab, spaces are as indicated the string "&Xx:1:1234:12345:123456$ABCDEFG..." has a slightly variable number of numbers and letters, but it always starts... (9 Replies)
Discussion started by: Tectona
9 Replies

12. Solaris

ps output truncated

Hi, I have Solaris-10 server. /usr/ucb/ps auxww is showing full path if I am running it from root. But if I run it from non-root user, its output is truncated. I don't want to use any other alternate command. Please suggest, what can be its solution. Terminal is set to term. (21 Replies)
Discussion started by: solaris_1977
21 Replies

13. UNIX for Beginners Questions & Answers

Remove or truncate trailing nulls from file

I want to remove from a file the trailing null characters (0x00) and stop doing so when a different byte is found (which should not be deleted), and either put the result to the same file or a different one. Any ideas? (9 Replies)
Discussion started by: Tribe
9 Replies

14. UNIX for Dummies Questions & Answers

Remove or truncate trailing nulls from file

(9 Replies)
Discussion started by: Tribe
9 Replies