About fifty years ago Mahler proved that if is rational but not an integer and if , then the fractional part of is apart from a finite set of integers depending on and . Answering completely a question of Mahler, we show that the same conclusion holds for all algebraic numbers which are not -th roots of Pisot numbers. By related methods we also answer a question of Mendès France, characterizing completely the real quadratic irrationals such that the continued fraction for has period length tending to infinity.