Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
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