meanig of mod 10 in mikrobasic

Status
Not open for further replies.

judfid

Member level 3
Joined
Feb 19, 2009
Messages
57
Helped
6
Reputation
12
Reaction score
6
Trophy points
1,288
Visit site
Activity points
1,597
(char/1000) mod 10, what does this mean in mikrobasic.can this. be written in asm?
 

Yes. It can be written in asm. When you want to convert int or float value like 2345 to string"2345" then you extract single digit of the number and convert it to sting by adding 0x30 or decimal 48. If you reverse it you get the integer value.

If your num is 12345 then num/1000 gives 12 (integer value)
12 mod 10 gives the remainder 2
Remember / gives the quotient and mod gives remainder.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…