L,

Did you rebuild your number before doing the division?

X=5*1000+8*100+9*10+4 ?

If yes, can you post your code snippet?