Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Ceil function in C


  • Please log in to reply

#1
troppo

troppo

    Member

  • Member
  • PipPipPip
  • 582 posts
Hi guys,

im trying to get the ceil function working in dev-C++ using the C language (Its compatable with both)

and usually when i type in a recognised word for example int or double it turns bold

when i type in the ceil function it does not turn bold even thou i am using the <math.h> header file


why is it that i can't seem to get it to work what am i doing wrong?
is there somethign that im not typing before the function or is it that its not a proper function in dev-C++


Thank you for any assistance that you can provide,
Troppo
  • 0

Advertisements


#2
hereitis

hereitis

    New Member

  • Member
  • Pip
  • 1 posts
i had the same problem but i realised that my problem was that i set my variable x of ceil(x) as an int instead of a double

so when i input a double number,
it reads the first digit only
leaving me with incorrect output
hope tt helps....
  • 0

#3
Swandog46

Swandog46

    Malware Expert

  • Member
  • PipPipPipPip
  • 1,026 posts
  • MVP
http://www.cplusplus...cmath/ceil.html

#include <math.h>

double result = ceil( 0.5 );
// result now contains 1.0.

  • 0

#4
Granz00

Granz00

    Member

  • Member
  • PipPipPip
  • 226 posts

and usually when i type in a recognised word for example int or double it turns bold

when i type in the ceil function it does not turn bold even thou i am using the <math.h> header file


Your "problem" isn't actually a problem. Both int, and double are keywords. That is why they appear in a different color. However, the name of a function is not a keyword, so it should appear normal. Have you compiled your code, to see if it actually works or not? If the program won't work, rather then you thinking it won't, then post your code and I'll try to look at it.

This is a link to a list of keywords for C. I didn't check the list to make sure it is completely right, but I'll take their word for it.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP