# trunc(3) [osx man page]

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

NAME
trunc -- truncate to integer value

SYNOPSIS
#include <math.h>

double
trunc(double x);

long double
truncl(long double x);

float
truncf(float x);

DESCRIPTION
The trunc() functions return the integral value nearest to but no larger in magnitude than x.

SPECIAL VALUES
trunc(+-0) returns +-0.

trunc(+-infinity) returns +-infinity.

VECTOR OPERATIONS
If you need to apply the trunc() function to SIMD vectors or arrays, using the following functions provided by the Accelerate.framework may
give significantly better performance:

#include <Accelerate/Accelerate.h>

vFloat vintf(vFloat x);
void vvintf(float *y, const float *x, const int *n);
void vvint(double *y, const double *x, const int *n);

ceil(3), floor(3), round(3), math(3)

STANDARDS
The trunc() functions conform to ISO/IEC 9899:2011.

BSD								 December 11, 2006							       BSD```

## Check Out this Related Man Page

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

NAME
fmod -- floating-point remainder function

SYNOPSIS
#include <math.h>

double
fmod(double x, double y);

long double
fmodl(long double x, long double y);

float
fmodf(float x, float y);

DESCRIPTION
The fmod() functions compute the floating-point remainder of x/ y.

Specifically, the functions return the value x-i*y, for some integer i such that, if y is non-zero, the result has the same sign as x and
magnitude less than the magnitude of y.

SPECIAL VALUES
fmod(+-0, y) returns +-0 if y is neither 0 nor NaN.

fmod(x, y) returns a NaN and raises the "invalid" floating-point exception for x infinite or y zero.

fmod(x, +-infinity) returns x for x not infinite.

VECTOR OPERATIONS
If you need to apply the fmod() functions to SIMD vectors or arrays, using the following functions provided by the Accelerate.framework may
give significantly better performance:

#include <Accelerate/Accelerate.h>

vFloat vfmodf(vFloat x, vFloat y);
void vvfmodf(float *z, const float *y, const float *x, const int *n);
void vvfmod(double *z, const double *y, const double *x, const int *n);

math(3)

STANDARDS
The fmod() functions conform to ISO/IEC 9899:2011.

BSD								 December 11, 2006							       BSD```
Man Page

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

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

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

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

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

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

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

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

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

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

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

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

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