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

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.