I don't understand this.

This is a discussion on I don't understand this. within the C Programming forums, part of the General Programming Boards category; Numbers inside the computer only get so big. If you think you're going to go past INT_MAX, then you should ...

  1. #16
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Numbers inside the computer only get so big. If you think you're going to go past INT_MAX, then you should pick either (1) a bigger data type or (2) a data type with a floating decimal point so you can store larger values (at the cost of losing exactness).

  2. #17
    Registered User
    Join Date
    Apr 2010
    Location
    Portland, OR
    Posts
    11
    So considering the assignment requires me to account for non whole numbers (floats) I have to change the coding in the Eval function. Hopefully at the lab we will be figuring that out today, thoughts?

  3. #18
    Registered User
    Join Date
    Jun 2009
    Posts
    457
    Pretty sure the negative number issue means that you are passing the maximum integer - you need to use long or long long or add an error message once you pass the maximum integer.

  4. #19
    Registered User
    Join Date
    Apr 2010
    Location
    Portland, OR
    Posts
    11
    Quote Originally Posted by KBriggs View Post
    Pretty sure the negative number issue means that you are passing the maximum integer - you need to use long or long long or add an error message once you pass the maximum integer.
    thanks!

  5. #20
    Registered User
    Join Date
    May 2010
    Location
    Las Vegas, NV
    Posts
    1
    I tested your posted solution with the input given in your assignment and it didn't seem to perform correctly. This was posted back in April though, have you already wrapped up this assignment?

  6. #21
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    How about you make your own thread for your own assignment, post your own attempt and ask your own questions, instead of just looking to reuse his answer?


    Quzah.
    Hope is the first step on the road to disappointment.

  7. #22
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by wkmanire View Post
    I tested your posted solution with the input given in your assignment and it didn't seem to perform correctly.
    I'm trying hard to imagine the kind of jackass that believes "didn't seem to perform correctly" counts as meaningful description or analysis, etc.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21