Jump to content

solved, cant delete topic


Xiija
 Share

You are about to reply to a thread that has been inactive for 327 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

  • Xiija changed the title to solved, cant delete topic

You're dividing 2 integers, which means the result will be an integer. (4388 / 65536)*100 = 0*100 = 0.  If you changed the order of operations to 100*4388/65536, the answer would be 6 (integer division rounds towards 0).

To use float division, you must cast to float (float percent = ((float)used/65536)*100), or, in this case since you're hardcoding the values and I won't question that, you can use a float literal (float percent = (4388.0/65536)*100).

  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...

And another one receives shared knowledge and removes the possibility of sharing that knowledge with others.

How selfish can people be with the generosity they receive?

This is like a hungry person asking for food and when you share with them they take a dump in the pot so nobody else can eat any.

  • Sad 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 327 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...