hi,
i need to ask how to generate the negative answer?
i have one formula. But always give me positive answer..
For exmaple:
AllocatDiff2 = 100 * -0.05;

hope somebody can help me ...ASAP!! Thanks ...

Recommended Answers

>>AllocatDiff2 = 100 * -0.05;

Looks negative to me. Something else must be going on. Post more code and a fuller explanation, particularly the type of AllocatDiff2.

Jump to Post

All 3 Replies

>>AllocatDiff2 = 100 * -0.05;

Looks negative to me. Something else must be going on. Post more code and a fuller explanation, particularly the type of AllocatDiff2.

hi,
i need to ask how to generate the negative answer?
i have one formula. But always give me positive answer..
For exmaple:
AllocatDiff2 = 100 * -0.05;

hope somebody can help me ...ASAP!! Thanks ...

is AllocatDiff2 and unsigned int?

Also, you should set your compiler warnings at the highest level, that way (if it is a signed/unsigned problem) issues like this will appear at compile-time.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.