Dev-c++ Math Functions

< C++ Programming‎ Code/Standard C Library
The latest reviewed version was checked on 9 June 2017. There are 2 pending changes awaiting review.

All Standard C Library Functions
[edit]

Dev C++ Math Library

FunctionsDescriptions
abortstops the program
absabsolute value without minus
acosarc cosine
asctimea textual version of the time
asinarc sine
assertstops the program if an expression isn't true
atanarc tangent
atan2arc tangent, using signs to determine quadrants
atexitsets a function to be called when the program exits
atofconverts a string to a double
atoiconverts a string to an integer
atolconverts a string to a long
bsearchperform a binary search
callocallocates and clears a two-dimensional chunk of memory
ceilthe smallest integer not less than a certain value
clearerrclears errors
clockreturns the amount of time that the program has been running
coscosine
coshhyperbolic cosine
ctimereturns a specifically formatted version of the time
difftimethe difference between two times
divreturns the quotient and remainder of a division
exitstop the program
expreturns 'e' raised to a given power
fabsabsolute value for floating-point numbers
fcloseclose a file
feoftrue if at the end-of-file
ferrorchecks for a file error
fflushwrites the contents of the output buffer
fgetcget a character from a stream
fgetposget the file position indicator
fgetsget a string of characters from a stream
floorreturns the largest integer not greater than a given value
fmodreturns the remainder of a division
fopenopen a file
fprintfprint formatted output to a file
fputcwrite a character to a file
fputswrite a string to a file
freadread from a file
freereturns previously allocated memory to the operating system
freopenopen an existing stream with a different name
frexpdecomposes a number into scientific notation
fscanfread formatted input from a file
fseekmove to a specific location in a file
fsetposmove to a specific location in a file
ftellreturns the current file position indicator
fwritewrite to a file
getcread a character from a file
getcharread a character from STDIN
getenvget environment information about a variable
getsread a string from STDIN
gmtimereturns a pointer to the current Greenwich Mean Time
isalnumtrue if a character is alphanumeric
isalphatrue if a character is alphabetic
iscntrltrue if a character is a control character
isdigittrue if a character is a digit
isgraphtrue if a character is a graphical character
islowertrue if a character is lowercase
isprinttrue if a character is a printing character
ispuncttrue if a character is punctuation
isspacetrue if a character is a space character
isuppertrue if a character is an uppercase character
itoaConvert a integer to a string
isxdigittrue if a character is a hexadecimal character
labsabsolute value for long integers
ldexpcomputes a number in scientific notation
ldivreturns the quotient and remainder of a division, in long integer form
localtimereturns a pointer to the current time
lognatural logarithm
log10natural logarithm, in base 10
longjmpstart execution at a certain point in the program
mallocallocates memory
memchrsearches an array for the first occurrence of a character
memcmpcompares two buffers
memcpycopies one buffer to another
memmovemoves one buffer to another
memsetfills a buffer with a character
mktimereturns the calendar version of a given time
modfdecomposes a number into integer and fractional parts
perrordisplays a string version of the current error to STDERR
powreturns a given number raised to another number
printfwrite formatted output to STDOUT
putcwrite a character to a stream
putcharwrite a character to STDOUT
putswrite a string to STDOUT
qsortperform a quicksort.
raisesend a signal to the program
randreturns a pseudo-random number
reallocchanges the size of previously allocated memory
removeerase a file
renamerename a file
rewindmove the file position indicator to the beginning of a file
scanfread formatted input from STDIN
setbufset the buffer for a specific stream
setjmpset execution to start at a certain point
setlocalesets the current locale
setvbufset the buffer and size for a specific stream
signalregister a function as a signal handler
sinsine
sinhhyperbolic sine
sprintfwrite formatted output to a buffer
sqrtsquare root
srandinitialize the random number generator
sscanfread formatted input from a buffer
strcatconcatenates two strings
strchrfinds the first occurrence of a character in a string
strcmpcompares two strings
strcollcompares two strings in accordance to the current locale
strcpycopies one string to another
strcspnsearches one string for any characters in another
strerrorreturns a text version of a given error code
strftimereturns individual elements of the date and time
strlenreturns the length of a given string
strncatconcatenates a certain amount of characters of two strings
strncmpcompares a certain amount of characters of two strings
strncpycopies a certain amount of characters from one string to another
strpbrkfinds the first location of any character in one string, in another string
strrchrfinds the last occurrence of a character in a string
strspnreturns the length of a substring of characters of a string
strstrfinds the first occurrence of a substring of characters
strtodconverts a string to a double
strtokfinds the next token in a string
strtolconverts a string to a long
strtoulconverts a string to an unsigned long
strxfrmconverts a substring so that it can be used by string comparison functions
systemperform a system call
tantangent
tanhhyperbolic tangent
timereturns the current calendar time of the system
tmpfilereturn a pointer to a temporary file
tmpnamreturn a unique filename
tolowerconverts a character to lowercase
toupperconverts a character to uppercase
ungetcputs a character back into a stream
va_arguse variable length parameter lists
vprintf, vfprintf, and vsprintfwrite formatted output with variable argument lists
vscanf, vfscanf, and vsscanfread formatted input with variable argument lists

The sqrt function in C returns the square root of a number. Mathematics √x = sqrt(x) In C Programming This function is defined in header file. Jun 09, 2017  From Wikibooks, open books for an open world. Asus ai suite fan auto tuning. Example: C built-in function example. Here we are using built-in function pow(x,y) which is x to the power y. This function is declared in cmath header file so we have included the file in our program using #include directive. Header declares a set of functions to compute common mathematical operations and transformations. A few days ago, I worked on project in VC. I found out, that math.h in VC differs much from dev-cpp math.h. Particulary its round function, that is not present in Visual C math.h, but is contained in dev-cpp math.

These routines included on the Standard C Library can be sub divided into:

Retrieved from 'https://en.wikibooks.org/w/index.php?title=C%2B%2B_Programming/Code/Standard_C_Library/Functions&oldid=3560645'

Dev C++ Math Functions

  1. Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, PHP, Python, Bootstrap, Java and XML.
  2. C reference C98, C03, C11, C14, C17, C20. Compiler support Freestanding implementations. Basic concepts C keywords Preprocessor Expressions Declaration. Common math functions Mathematical special functions (C17) Numeric algorithms Pseudo-random number generation.
P: n/a
What does the standard guarantee about the accuracy of eg the
trigonometric functions? There is obviously an implementation-dependent
upper bound on the accuracy, since the answer is stored in a double,
but is this bound actually achieved?
First, a simple example
Suppose I want the arc cosine of -1, and use acos(-1.0) to compute it.
The correct answer to 25 hexadecimal digits is
-3.243F6A8885A308D313198A2E. This falls between two exactly
representable doubles, call them A and B. Does the standard guarantee
that I get one of A and B as the answer (or even better, than I get the
one that is closer to the right answer)?
A more difficult example.
Suppose I want sin(exp(100)). The value of exp(100) is not exactly
representable in a double, and in fact, all numbers in the range
exp(100)-pi to exp(100)+pi have the same closest representation as a
double. Does this authorize the implementation to give any answer it
likes (in the interval [-1,1]), or is it required to give a value close
to the sine of the number it uses to represent exp(100)? Requiring the
right answer here would be a lot of work.
Thomas Lumley (thomas at drizzle dot net)