Is $w=mg$ the right way to calculate mass?

How can you find the mass of an object by using a weight and a gravitational acceleration from another planet then earth? I was given $5.8\text{ N}$ and an acceleration of $4.0\ \mathrm{m/s^2}$. The answer I keep getting is $1.45\text{ kg}$, but the real answer is supposed to be $.58\text{ kg}$. I'm using the formula $w=mg$. Am I doing something wrong?

-
Your numbers and method look reasonable to me. Are you sure you aren't getting things mixed up? A mass of .58kg and weight of 5.8N would be consistent with a gravitational acceleration of 9.8 $\frac{m}{s^2} \approx 10 \frac{m}{s^2}$ of earth. – DJBunk Sep 27 '12 at 1:35
Thanks and I knew I was right. I guess the book was wrong. This isn't the first time though. – John Smithwell Sep 27 '12 at 1:53
Hi John, and welcome to Physics Stack Exchange! For future reference, generally we discourage questions that just ask for someone to check your work. Once you have identified the specific concept that you're not sure about, that's the point at which it's appropriate to ask a question here. But in this case, given that you were misled by the book having the wrong answer (and given that the question is as simple as it is), I suppose it's fine. – David Z Sep 27 '12 at 4:27
@DJBunk perhaps you could post that as an answer? – David Z Sep 27 '12 at 4:27

Your method looks correct. $W = mg$, therefore $m = W/g$.
Therefore $m = 5.8/4 = 1.45kg$
Therefore your book has got the answer wrong unfortunately. The book used $g=10m/s/s$, which is approximately the acceleration due to gravity on Earth.