What are Floor Ceiling Absolute Value and Remainder Functions in Standard C Library

Notice thatfloor() function returns largest integral value not greater than its argument. ceil() function returns smallest integral value not less than its argument.fabs() returns absolute value of its argument and fmod() returns remainder of division of val1 by val2. Lets take examples of floor() and ceil() functions below

EOF, FOPEN_MAX and FILENAME_MAX Constants

What is Power Function in Standard C Library

error, pragma and null Directives

C Tutorials – FunctionsStatic Function Parameters

User, enter value for floor evaluation…

C Programming Examples on Bitwise Operations

Next Page – What are Date and Time Functions in Standard C Library

Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer and SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage & Cluster Administration, Advanced C Programming, SAN Storage Technologies, SCSI Internals and Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him below:

floor(), ceil(), fabs() and fmod() Functions

C Tutorials – ArraysArray Vs. Variable

C Pointers – addressof (&) and asterisk (*)

What are Date and Time Functions in Standard C Library

Linked List – Dynamic vs. Static Memory Allocation

Sanfoundry isNo. 1choice for Deep Hands-ON Trainings inSAN, Linux & C, Kernel Programming. Our Founder has trained employees of almost all Top Companies in India such as VMware, Citrix, Oracle, Motorola, Ericsson, Aricent, HP, Intuit, Microsoft, Cisco, SAP Labs, Siemens, Symantec, Redhat, Chelsio, Cavium, ST-Micro, Samsung, LG-Soft, Wipro, TCS, HCL, IBM, Accenture, HSBC, Mphasis, Tata-Elxsi, Tata VSNL, Mindtree, Cognizant and Startups.Best TrainingsSAN I – Technology

Prev PageNext PageWhat are Floor, Ceiling, Absolute Value and Remainder Functions in Standard C LibraryPosted onJuly 24, 2014byManishQuestion:What are Floor, Ceiling, Absolute Value and Remainder Functions in Standard C Library?

Java Programming Examples on Mathematical Functions

User, enter value for ceiling evaluation…

India InternshipsComputer Science Internships

Array – Static and Automatic Initialization

Constant Pointer Vs. Regular Pointer

/* fp_ceil_fun.c — ceil() returns smallest integer not less */

C Tutorials – Character & StringsType size_t

Prev Page – What is Power Function in Standard C Library

Multidimensional Arrays as Function Arugments

Linkage and Scope of Variables & Functions

C Tutorials – Structures & PointersLinked List

Sanfoundry Global Education Learning Series 1000 C Tutorials.

C Programming Examples on Mathematical Functions

Common Errors – Dynamic Memory Allocation

Ordered vs. Unordered – Singly Linked List

String Literals Operations Using Pointers

If you wish to look at all C Tutorials, go toC Tutorials.

Pointer Arithematic – Struct vs. Arrays

Try to work-out other two interesting functions to understand them by implementing.

C Tutorials – Advanced PointersPointer to Pointer

C Tutorials – Operators & ExpressionsC Expression

C Tutorials – File I/OProgram Portability

Double Pointer or Pointer-to-Pointer

Pointer Indirection or Dereferencing

/* lets evaluate ceiling of value */

C Tutorials – DMACompile-Time vs. Run-Time Memory Allocation

C Tutorials – Structures & UnionsArrays vs. Structures

C Programming Examples on Functions

Code, Data, Heap and Stack Segements

C Tutorials – PreprocessorsCompiler vs. Preprocessor

Questions and Answers1000 C Questions & Answers

C Tutorials – Runtime EnvironmentAssembly Code

C Tutorials – C LibraryStandard C Library

Logarithmic and Exponential Functions

Structure Padding – Boundary Alignment

Answer:Standard C Library defines floor(), ceil(), fabs() and fmod() functions with return values and their arguments as type double because of greater range of double values over integer values. These are prototyped as below,

Function Agruments – Actual Vs. Formal

Java Programming Examples on Arrays

Best Reference BooksComputer Science Books

abs(), labs(), div() and ldiv() Functions

/* fp_floor_fun.c — floor() returns largest integer not greater */

Restricted vs. Unrestricted String Function

Structure – Function Argument & Return

What are Floor Ceiling Absolute Value and Remainder Functions in Standard C Library

Leave a Reply