Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

One can extract an Integer's digits using IntegerDigits and reassemble them into the Integer using FromDigits. Is there a function that reassembles the output of RealDigits into the Real?

share|improve this question
3  
N@FromDigits[RealDigits[123.55555]]? – kglr Jul 5 '14 at 4:29
1  
@kguler: didn't realize fromdigits accounted for offset.. right in the details in the doc... +1 – ciao Jul 5 '14 at 4:31
    
@kguler Post an answer? It seems it's worth spelling out because people are not always aware that FromDigit already does this. – Szabolcs Jul 5 '14 at 4:33
    
@Szabolcs & rasher thank you both. Posted an answer. – kglr Jul 5 '14 at 8:07
up vote 7 down vote accepted

From FromDigits>>Details:

Blockquote

For example:

N@FromDigits[RealDigits[123.55555]]
(* 123.556 *) 
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.