This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem with long value multiplication

Dear sir,
i used the compiler for long value multiplication it works good upto 69 multiplied by 10000. after that it doesn't show any error in compiling. it stores the values within 65536. After that it druncate the uppermost part in hex. to avoid this i first multiply with 1000 in one long variable & assign other variable for multiply by 10. are u have any solution for this.

Parents
  • Are the values you multiply int types or long types. IF you multiply 2 ints, the result will be an int even if you finally store this value in a long. If both values are int, you should cast at least one of them to a long type.

    Jon

Reply
  • Are the values you multiply int types or long types. IF you multiply 2 ints, the result will be an int even if you finally store this value in a long. If both values are int, you should cast at least one of them to a long type.

    Jon

Children
No data