SlideShare une entreprise Scribd logo
1  sur  45
Télécharger pour lire hors ligne
Standard library contains the
prepackaged functions which are used
while writing a ‘c’ program.
 This header file contains a number of pre-
defined/ library functions which performs
various mathematical calculations.
 To include math.h header file in program use
preprocessor directive-
#include< math.h >
 Modulus function calculates the remainder of
the division operation.
 In ‘c’ modulus function is applied on integer
numbers only by default.
 To apply modulus to floating point values we
use fmod , fmod l ,modf , modf l.
 Modf / modf l splits double/ long double
number into integer and fractional part
respectively.
 It stores the integer in ipart and returns the
fraction.
•Declaration :-
•Fmod , fmod l :-
double fmod (double x , double y);
long double fmod l(long double (x) , long double (y))
•Modf , modf l :-
double modf (double x , double *(ipart));
long double modf l(long double (x) , long double
*(ipart));
ARC FUNCTIONS
SIMPLE
FUNCTIONS
 acos
 asin
 atan
 atan2
 acosl
 asinl
 atanl
 atn2l
 cos
 sin
 tan
Declarations :-
• Real :-
1. doubleacos(double x);
2. doubleasin(double x);
3. doubleatan(double x);
4. doubleatan2(double x ,double y);
5. long double acosl(longdouble (x));
6. long double asinl(longdouble (x));
7. long double atanl(longdouble (x));
8. longdouble atan2l(longdouble(x), long double (y));
• Complex :-
1. Complex acos(complex x);
2. Complex asin(complex x);
3. complex atan(complex x);
Declarations :-
•Real :-
1. Double cos (double x);
2. Double sin (double x);
3. Double tan (double x);
4. Longdouble cos (long double x);
5. Longdouble sin (long double x);
6. Longdouble tan (long double x);
• Complex :-
1. Complex cos (complex x);
2. Complex sin (complex x);
3. complex tan (complex x);
 cosh
 sinh
 tanh
 coshl
 sinhl
 tanhl
Declarations :-
• Real :-
1. Double cosh (double x );
2. Double sinh (double x);
3. Double tanh (double x);
4. Long double coshl (long double x);
5. Long double sinhl (long double x);
6. Long double tanh (long double x);
• Complex :-
1. Complex cosh (complex x);
2. Complex sinh (complex x);
3. Complex tanh (complex x);
power function calculates the power of an input
number.
Syntax :-
power( base , exponent);
TO CALCULATE
POWER OF A
‘DESIRED’ NUMBER
TO CALCULATE
POWER OF ‘10’
 pow
 powl
 Pow10
 Pow10 l
Declaration :-
•Power :-
1. Double pow (double n , double p );
2. Long double pow (long double (n) , long double (p
3. Complex pow (complex n , complex p);
4. Complex pow (double n , complex p);
5. Complex pow (complex n , double p);
• Power10 :-
1. Double pow10 (int p);
2. Long double pow10 (int (p));
 Floor function rounds the value down.
 Floor returns integer found as double.
 Floorl returns integer found as long double.
 Declaration :-
double floor (double x);
long double floorl(long double (x));
 Ceiling function rounds up a number.
 Ceil returns an integer found as double.
 Ceill returns an integer found as long double.
Declaration :-
double ceil (double x);
long double ceil (long double (x));
 Exponential function is used to calculate the
powers of ‘e’.
 For Real numbers ‘e’ raised to power ‘x’ is
calculated.
 For complex numbers ‘e’ raised to power ‘z’ is
calculated (z is a complex number).
Declaration :-
• Real :-
1. double exp(double x);
2. long double exp (long double (x));
•Complex :-
1. complex exp(complex (z));
 square root function is used to calculate the
square root of a given number.
 Declaration :-
 Real :-
double sqrt (double x);
long double sqrt (long double (x));
 Complex :-
complex sqrt (complex x);
 absolute value function returns only the numerical
value without any sign.
 There are different types of abs function :-
o abs (a macro) finds absolute value of an integer .
o fabs , fabs l (macros) finds absolute values of
floating point values.
o Cabs , cabs l finds absolute values for complex
numbers.
o labs finds absolute values for long double values.
•Declaration :-
•abs :-
Real - int abs (int x);
Complex - complex abs (complex z);
•Fabs , fabd l :-
double fabs (double x);
long double fabs (long double @E(x));
•Cabs , cabd l :-
double cabs (struct_complex z);
long double cabd l (struct_complexl z);
•Labs :-
long int labs(long int x);
 This header file contains prepackaged
functions to perform various operations on
‘characters’.
 To include this header file in the program use
the preprocessor directive-
# include < ctype.h >
 toupper is a function which converts lowercase
characters to uppercase characters. If the input
character is already uppercase character then
those characters remain unchanged.
 _toupper is a macro which also converts
lowercase characters to uppercase characters.
But if the input characters have uppercase
characters in it then the result of _toupper is
‘undefined’.
•Declarations :-
1. int toupper (char ch);
2. Int _toupper (char ch);
 tolower is a function which converts uppercase
characters to lowercase characters. If the input
character is already lowercase character then
those characters remain unchanged.
 _tolower is a macro which also converts
uppercase characters to lowercase characters.
But if the input characters have lowercase
characters in it then the result of _tolower is
‘undefined’.
•Declarations :-
1. int tolower (char ch);
2. Int _tolower (char ch);
 Isspace checks it out whether an input
character is a space , tab , carriage return , new
line , vertical tab , or formfeed or not.
 It is a macro and returns a non-zero value on
success.
 Declaration :-
int isspace ( int c );
 The lower order byte of character is in the
range 0 to 127.
 It is a macro and returns a non-zero value on
success.
 Declaration :-
int isascii (int c);
 Isprint checks it out whether the input
character is a printing character or not.
 It is also a macro and returns a non-zero value
on success.
 Declaration :-
int isprint (int c);
 Isgraph checks it out whether input character is
a printing character or not like isprint except
that space character is excluded.
 It is also a macro &returns non-zero value on
success.
 Declaration :-
int isgraph (int c);
 iscntrl checks it whether the input character is a
delete character or an ordinary control
character .
 It is also a macro &returns non-zero value on
success.
 Declaration :-
int iscntrl ( int c);
 isxdigit checks out whether the input character
is a hexadecimal digit or not ( A to F , a to f , 0
to 9).
 It is also a macro &returns non-zero value on
success.
 Declaration :-
int isxdigit (int c);
 To include this header file in the program use
the preprocessor directive-
# include < stdlib.h >
 Abnormally terminates a process & writes a
termination message on stderr(“abnormal
program termination “) and then aborts the
program by a call to _exit with exit code 3.
 Declaration :-
void abort (void);
 atof converts a sting to floating point value .
 _atold converts a string to long double.
 Declaration :-
double atof (const char *s);
long double _atold (const char *(s));
 It is a macro that converts the string to integer.
 Declaration :-
int atoi (const char *s);
 Swab function copies nbytes from the “from”
string to the “to” string .nbytes should be even
.
 Adjacent even &odd bytes are swapped.
 This is useful for moving data from one
machine to another machine in different bytes
order.
 Declaration :-
void swab(char *from, char *to, int nbytes);
 System invokes the DOS command interpreter
file from inside an executing ‘c’ program to
execute a DOS command ,batch file , or other
program named by the string “command”.
 Declaration :-
int system (const char *command);
 time.h header file contains various functions
operating on time .
 Like clock, ctime, stime, time, difftime, acstime,
mktime, gmtime, localtime, etc.
 To include this header file in the program use
preprocessor directive-
# include < time.h >
 Clock returns the number of clock ticks since
program start.
 Clock can be used to determine the time
interval between two events.
 Declaration :-
clock_t clock (void);
 Asctime converts date and time to ascii.
 Ctime converts date and time to a string.
 Declaration :-
char *acstime (const struct tm *tblock);
char *ctime (const time_t *time);
 mktime converts time to calendar format .
 Declaration :-
time_t mktime (struct tm *t);
 time gets time of day.
 stime gets system date and time.
 Declaration :-
time_t time (time_t *timer );
int stime (time_t *tp);
 Difftime computes difference between 2 times.
 Declaration :-
double difftime(time_t time2,time_t time1);
 Gmtime converts date and time to Greenwich
Mean Time (GMT).
 Localtime converts date and time to a structure.
 Declaration :-
struct tm *gmtime(const time_t *timer);
struct tm *localtime(const time_t *timer);
MADE BY :-
VAISHNAVEE SHARMA

Contenu connexe

Tendances

Tendances (20)

Functions in C
Functions in CFunctions in C
Functions in C
 
Functions in c language
Functions in c language Functions in c language
Functions in c language
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
structure and union
structure and unionstructure and union
structure and union
 
Function in C program
Function in C programFunction in C program
Function in C program
 
Function Pointer
Function PointerFunction Pointer
Function Pointer
 
Looping statements in C
Looping statements in CLooping statements in C
Looping statements in C
 
Strings
StringsStrings
Strings
 
Control statements in c
Control statements in cControl statements in c
Control statements in c
 
Strings Functions in C Programming
Strings Functions in C ProgrammingStrings Functions in C Programming
Strings Functions in C Programming
 
Pointers
PointersPointers
Pointers
 
Strings in C language
Strings in C languageStrings in C language
Strings in C language
 
Handling of character strings C programming
Handling of character strings C programmingHandling of character strings C programming
Handling of character strings C programming
 
C programming - Pointers
C programming - PointersC programming - Pointers
C programming - Pointers
 
C string
C stringC string
C string
 
constants, variables and datatypes in C
constants, variables and datatypes in Cconstants, variables and datatypes in C
constants, variables and datatypes in C
 
What are variables and keywords in c++
What are variables and keywords in c++What are variables and keywords in c++
What are variables and keywords in c++
 
Structure in C
Structure in CStructure in C
Structure in C
 
Pointers in c++
Pointers in c++Pointers in c++
Pointers in c++
 
Functions in c
Functions in cFunctions in c
Functions in c
 

En vedette

Library Management System Project in C
Library Management System Project in CLibrary Management System Project in C
Library Management System Project in Ccodewithc
 
ARCHITECTURAL STANDARDS
ARCHITECTURAL STANDARDSARCHITECTURAL STANDARDS
ARCHITECTURAL STANDARDSstuti31
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programmingavikdhupar
 
10 Creative Thinking Puzzles
10 Creative Thinking Puzzles10 Creative Thinking Puzzles
10 Creative Thinking PuzzlesOH TEIK BIN
 
Library Management System
Library Management SystemLibrary Management System
Library Management SystemAditya Shah
 
Computer Graphics Concepts
Computer Graphics ConceptsComputer Graphics Concepts
Computer Graphics ConceptsSHAKOOR AB
 
Functions in c
Functions in cFunctions in c
Functions in cInnovative
 
Intro to cprogramming
Intro to cprogrammingIntro to cprogramming
Intro to cprogrammingskashwin98
 
Introduction to go language programming
Introduction to go language programmingIntroduction to go language programming
Introduction to go language programmingMahmoud Masih Tehrani
 
GO programming language
GO programming languageGO programming language
GO programming languagetung vu
 
Programming with c language practical manual
Programming with c language practical manualProgramming with c language practical manual
Programming with c language practical manualAnil Bishnoi
 
2010 PAARL Standards for Academic Libraries (Draft Proposal)
2010 PAARL Standards for Academic Libraries (Draft Proposal)2010 PAARL Standards for Academic Libraries (Draft Proposal)
2010 PAARL Standards for Academic Libraries (Draft Proposal)Fe Angela Verzosa
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Languagesatvirsandhu9
 
Library management in Data structure
Library management in Data structure Library management in Data structure
Library management in Data structure harshil1902
 

En vedette (20)

Android
Android Android
Android
 
Library Management System Project in C
Library Management System Project in CLibrary Management System Project in C
Library Management System Project in C
 
functions in C
functions in Cfunctions in C
functions in C
 
ARCHITECTURAL STANDARDS
ARCHITECTURAL STANDARDSARCHITECTURAL STANDARDS
ARCHITECTURAL STANDARDS
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programming
 
10 Creative Thinking Puzzles
10 Creative Thinking Puzzles10 Creative Thinking Puzzles
10 Creative Thinking Puzzles
 
Library Management System
Library Management SystemLibrary Management System
Library Management System
 
Computer Graphics Concepts
Computer Graphics ConceptsComputer Graphics Concepts
Computer Graphics Concepts
 
Otaku
OtakuOtaku
Otaku
 
What is Otaku
What is OtakuWhat is Otaku
What is Otaku
 
Functions in c
Functions in cFunctions in c
Functions in c
 
C-Header file
C-Header fileC-Header file
C-Header file
 
Intro to cprogramming
Intro to cprogrammingIntro to cprogramming
Intro to cprogramming
 
Introduction to go language programming
Introduction to go language programmingIntroduction to go language programming
Introduction to go language programming
 
GO programming language
GO programming languageGO programming language
GO programming language
 
Programming with c language practical manual
Programming with c language practical manualProgramming with c language practical manual
Programming with c language practical manual
 
2010 PAARL Standards for Academic Libraries (Draft Proposal)
2010 PAARL Standards for Academic Libraries (Draft Proposal)2010 PAARL Standards for Academic Libraries (Draft Proposal)
2010 PAARL Standards for Academic Libraries (Draft Proposal)
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Language
 
Library management in Data structure
Library management in Data structure Library management in Data structure
Library management in Data structure
 
Library Standards: CHED Policies and Guidelines on Book Holdings
Library Standards: CHED Policies and Guidelines on Book HoldingsLibrary Standards: CHED Policies and Guidelines on Book Holdings
Library Standards: CHED Policies and Guidelines on Book Holdings
 

Similaire à C standard library functions

C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial javaTpoint s
 
C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)Saifur Rahman
 
Functions and pointers_unit_4
Functions and pointers_unit_4Functions and pointers_unit_4
Functions and pointers_unit_4Saranya saran
 
Function in c program
Function in c programFunction in c program
Function in c programumesh patil
 
Programming in C (part 2)
Programming in C (part 2)Programming in C (part 2)
Programming in C (part 2)SURBHI SAROHA
 
Introduction to c
Introduction to cIntroduction to c
Introduction to camol_chavan
 
Functions and pointers_unit_4
Functions and pointers_unit_4Functions and pointers_unit_4
Functions and pointers_unit_4MKalpanaDevi
 
C Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointJavaTpoint.Com
 
46630497 fun-pointer-1
46630497 fun-pointer-146630497 fun-pointer-1
46630497 fun-pointer-1AmIt Prasad
 
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingRasan Samarasinghe
 
Programming Fundamentals Functions in C and types
Programming Fundamentals  Functions in C  and typesProgramming Fundamentals  Functions in C  and types
Programming Fundamentals Functions in C and typesimtiazalijoono
 

Similaire à C standard library functions (20)

C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial
 
C++ Homework Help
C++ Homework HelpC++ Homework Help
C++ Homework Help
 
C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)
 
Functions and pointers_unit_4
Functions and pointers_unit_4Functions and pointers_unit_4
Functions and pointers_unit_4
 
Function in c program
Function in c programFunction in c program
Function in c program
 
venkatesh.pptx
venkatesh.pptxvenkatesh.pptx
venkatesh.pptx
 
Programming in C (part 2)
Programming in C (part 2)Programming in C (part 2)
Programming in C (part 2)
 
C function
C functionC function
C function
 
Functionincprogram
FunctionincprogramFunctionincprogram
Functionincprogram
 
Introduction to c
Introduction to cIntroduction to c
Introduction to c
 
Functions and pointers_unit_4
Functions and pointers_unit_4Functions and pointers_unit_4
Functions and pointers_unit_4
 
C Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpoint
 
46630497 fun-pointer-1
46630497 fun-pointer-146630497 fun-pointer-1
46630497 fun-pointer-1
 
C++ Language
C++ LanguageC++ Language
C++ Language
 
Matlab-3.pptx
Matlab-3.pptxMatlab-3.pptx
Matlab-3.pptx
 
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programming
 
C notes.pdf
C notes.pdfC notes.pdf
C notes.pdf
 
Alp 05
Alp 05Alp 05
Alp 05
 
Alp 05
Alp 05Alp 05
Alp 05
 
Programming Fundamentals Functions in C and types
Programming Fundamentals  Functions in C  and typesProgramming Fundamentals  Functions in C  and types
Programming Fundamentals Functions in C and types
 

Dernier

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterMateoGardella
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfSanaAli374401
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 

Dernier (20)

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 

C standard library functions

  • 1. Standard library contains the prepackaged functions which are used while writing a ‘c’ program.
  • 2.  This header file contains a number of pre- defined/ library functions which performs various mathematical calculations.  To include math.h header file in program use preprocessor directive- #include< math.h >
  • 3.  Modulus function calculates the remainder of the division operation.  In ‘c’ modulus function is applied on integer numbers only by default.  To apply modulus to floating point values we use fmod , fmod l ,modf , modf l.  Modf / modf l splits double/ long double number into integer and fractional part respectively.  It stores the integer in ipart and returns the fraction.
  • 4. •Declaration :- •Fmod , fmod l :- double fmod (double x , double y); long double fmod l(long double (x) , long double (y)) •Modf , modf l :- double modf (double x , double *(ipart)); long double modf l(long double (x) , long double *(ipart));
  • 5. ARC FUNCTIONS SIMPLE FUNCTIONS  acos  asin  atan  atan2  acosl  asinl  atanl  atn2l  cos  sin  tan
  • 6. Declarations :- • Real :- 1. doubleacos(double x); 2. doubleasin(double x); 3. doubleatan(double x); 4. doubleatan2(double x ,double y); 5. long double acosl(longdouble (x)); 6. long double asinl(longdouble (x)); 7. long double atanl(longdouble (x)); 8. longdouble atan2l(longdouble(x), long double (y)); • Complex :- 1. Complex acos(complex x); 2. Complex asin(complex x); 3. complex atan(complex x);
  • 7. Declarations :- •Real :- 1. Double cos (double x); 2. Double sin (double x); 3. Double tan (double x); 4. Longdouble cos (long double x); 5. Longdouble sin (long double x); 6. Longdouble tan (long double x); • Complex :- 1. Complex cos (complex x); 2. Complex sin (complex x); 3. complex tan (complex x);
  • 8.  cosh  sinh  tanh  coshl  sinhl  tanhl
  • 9. Declarations :- • Real :- 1. Double cosh (double x ); 2. Double sinh (double x); 3. Double tanh (double x); 4. Long double coshl (long double x); 5. Long double sinhl (long double x); 6. Long double tanh (long double x); • Complex :- 1. Complex cosh (complex x); 2. Complex sinh (complex x); 3. Complex tanh (complex x);
  • 10. power function calculates the power of an input number. Syntax :- power( base , exponent);
  • 11. TO CALCULATE POWER OF A ‘DESIRED’ NUMBER TO CALCULATE POWER OF ‘10’  pow  powl  Pow10  Pow10 l
  • 12. Declaration :- •Power :- 1. Double pow (double n , double p ); 2. Long double pow (long double (n) , long double (p 3. Complex pow (complex n , complex p); 4. Complex pow (double n , complex p); 5. Complex pow (complex n , double p); • Power10 :- 1. Double pow10 (int p); 2. Long double pow10 (int (p));
  • 13.  Floor function rounds the value down.  Floor returns integer found as double.  Floorl returns integer found as long double.  Declaration :- double floor (double x); long double floorl(long double (x));
  • 14.  Ceiling function rounds up a number.  Ceil returns an integer found as double.  Ceill returns an integer found as long double. Declaration :- double ceil (double x); long double ceil (long double (x));
  • 15.  Exponential function is used to calculate the powers of ‘e’.  For Real numbers ‘e’ raised to power ‘x’ is calculated.  For complex numbers ‘e’ raised to power ‘z’ is calculated (z is a complex number).
  • 16. Declaration :- • Real :- 1. double exp(double x); 2. long double exp (long double (x)); •Complex :- 1. complex exp(complex (z));
  • 17.  square root function is used to calculate the square root of a given number.  Declaration :-  Real :- double sqrt (double x); long double sqrt (long double (x));  Complex :- complex sqrt (complex x);
  • 18.  absolute value function returns only the numerical value without any sign.  There are different types of abs function :- o abs (a macro) finds absolute value of an integer . o fabs , fabs l (macros) finds absolute values of floating point values. o Cabs , cabs l finds absolute values for complex numbers. o labs finds absolute values for long double values.
  • 19. •Declaration :- •abs :- Real - int abs (int x); Complex - complex abs (complex z); •Fabs , fabd l :- double fabs (double x); long double fabs (long double @E(x)); •Cabs , cabd l :- double cabs (struct_complex z); long double cabd l (struct_complexl z); •Labs :- long int labs(long int x);
  • 20.  This header file contains prepackaged functions to perform various operations on ‘characters’.  To include this header file in the program use the preprocessor directive- # include < ctype.h >
  • 21.  toupper is a function which converts lowercase characters to uppercase characters. If the input character is already uppercase character then those characters remain unchanged.  _toupper is a macro which also converts lowercase characters to uppercase characters. But if the input characters have uppercase characters in it then the result of _toupper is ‘undefined’.
  • 22. •Declarations :- 1. int toupper (char ch); 2. Int _toupper (char ch);
  • 23.  tolower is a function which converts uppercase characters to lowercase characters. If the input character is already lowercase character then those characters remain unchanged.  _tolower is a macro which also converts uppercase characters to lowercase characters. But if the input characters have lowercase characters in it then the result of _tolower is ‘undefined’.
  • 24. •Declarations :- 1. int tolower (char ch); 2. Int _tolower (char ch);
  • 25.  Isspace checks it out whether an input character is a space , tab , carriage return , new line , vertical tab , or formfeed or not.  It is a macro and returns a non-zero value on success.  Declaration :- int isspace ( int c );
  • 26.  The lower order byte of character is in the range 0 to 127.  It is a macro and returns a non-zero value on success.  Declaration :- int isascii (int c);
  • 27.  Isprint checks it out whether the input character is a printing character or not.  It is also a macro and returns a non-zero value on success.  Declaration :- int isprint (int c);
  • 28.  Isgraph checks it out whether input character is a printing character or not like isprint except that space character is excluded.  It is also a macro &returns non-zero value on success.  Declaration :- int isgraph (int c);
  • 29.  iscntrl checks it whether the input character is a delete character or an ordinary control character .  It is also a macro &returns non-zero value on success.  Declaration :- int iscntrl ( int c);
  • 30.  isxdigit checks out whether the input character is a hexadecimal digit or not ( A to F , a to f , 0 to 9).  It is also a macro &returns non-zero value on success.  Declaration :- int isxdigit (int c);
  • 31.  To include this header file in the program use the preprocessor directive- # include < stdlib.h >
  • 32.  Abnormally terminates a process & writes a termination message on stderr(“abnormal program termination “) and then aborts the program by a call to _exit with exit code 3.  Declaration :- void abort (void);
  • 33.  atof converts a sting to floating point value .  _atold converts a string to long double.  Declaration :- double atof (const char *s); long double _atold (const char *(s));
  • 34.  It is a macro that converts the string to integer.  Declaration :- int atoi (const char *s);
  • 35.  Swab function copies nbytes from the “from” string to the “to” string .nbytes should be even .  Adjacent even &odd bytes are swapped.  This is useful for moving data from one machine to another machine in different bytes order.  Declaration :- void swab(char *from, char *to, int nbytes);
  • 36.  System invokes the DOS command interpreter file from inside an executing ‘c’ program to execute a DOS command ,batch file , or other program named by the string “command”.  Declaration :- int system (const char *command);
  • 37.  time.h header file contains various functions operating on time .  Like clock, ctime, stime, time, difftime, acstime, mktime, gmtime, localtime, etc.  To include this header file in the program use preprocessor directive- # include < time.h >
  • 38.  Clock returns the number of clock ticks since program start.  Clock can be used to determine the time interval between two events.  Declaration :- clock_t clock (void);
  • 39.  Asctime converts date and time to ascii.  Ctime converts date and time to a string.  Declaration :- char *acstime (const struct tm *tblock); char *ctime (const time_t *time);
  • 40.  mktime converts time to calendar format .  Declaration :- time_t mktime (struct tm *t);
  • 41.  time gets time of day.  stime gets system date and time.  Declaration :- time_t time (time_t *timer ); int stime (time_t *tp);
  • 42.  Difftime computes difference between 2 times.  Declaration :- double difftime(time_t time2,time_t time1);
  • 43.  Gmtime converts date and time to Greenwich Mean Time (GMT).  Localtime converts date and time to a structure.  Declaration :- struct tm *gmtime(const time_t *timer); struct tm *localtime(const time_t *timer);
  • 44.