It is currently Wed Dec 04, 2013 8:43 pm

 All times are UTC

 Page 1 of 1 [ 2 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Am I stupid?Posted: Mon Apr 09, 2012 11:42 pm
 Grand Optimizer

Joined: Mon Jan 17, 2005 6:01 pm
Posts: 356
Code:
get
{

A = ((B / C) * 100);

return A;

}

B) starting value: 11
C) starting value: 100

A evaluates to 0. This isn't complicated math. The logic was working earlier, but now it isn't. I can even take a screenshot in my IDE and clearly show the values that are in the variables at the time i've got the loop paused. Unless im overlooking something embarrasingly simple, ive got an actual arithmetic error on my hands. I didnt think that was possible.

A should evaluate to 11, not 0.

Any help?

Thanks

EDIT: As it turns out, it was an issue to do with ints vs floats and blah blah yeah so to answer my original question: Yes, I am infact stupid. lol.

_________________
"None are more hopelessly enslaved than those who falsely believe they are free."
"It is no measure of health to be well adjusted to a profoundly sick society."
"Hope is the first step on the road to dissapointment." -Jonah Orion
http://tankzgame.blogspot.com

Top

 Post subject: Re: Am I stupid?Posted: Tue Apr 10, 2012 7:12 am
 Harmlessness does no harm

Joined: Tue Sep 14, 2004 8:37 pm
Posts: 3913
Location: Ferriday, LA, US
Meneliki wrote:
Yes, I am infact stupid. lol.

Welcome to Club Human.

(I've encountered this exact problem before, first time when I was learning Java. Took three days of fighting before someone noticed my formula required an explicit cast to avoid the flooring error... so don't feel too special.)

_________________
What most people don't understand about "enlightenment" is that it is not an end-goal; but where you find yourself just before taking a new "first step."

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 2 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: No registered users and 3 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forum

Search for:
 Jump to:  Select a forum ------------------ Forums    Forum Rules and Posting Guidelines Wiki Discussion    Help    Content Issues Game Programming Discussion    C and C++ Game Programming    Java Game Programming    Language Agnostic Programming    .NET Game Programming    VB Game Programming    Mobile Game Programming    Web-Based Game Programming    Other Languages    OpenGL Development    Direct X Development Game Development Discussion    Game Design    Game Media Off-Topic Discussion    Announcements    Off-Topic    Community Projects    News