MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Puzzled by IntegerPart


Hi,

> Round and Rational have solved the problem. But I am curious, why do
> the phantom decimals not show with N?
> 
> N[100*1.15, 20]
> 
> 115.

N has no influence on the formatting but is used to convert to floating
point numbers. What you want is either of these:

FullForm[100*1.15]

InputForm[100*1.15]


hth,

albert

PS: Does anyone understand why

NumberForm[100*1.15, 20]

will be shown as 115. ? Is this really the intended behavior?


  • Prev by Date: Re: LessEqual vs Inequality, was ..Re: Replacement Rule with Sqrt
  • Next by Date: Re: Question: Compile in Mathematica 8.0
  • Previous by thread: Re: Puzzled by IntegerPart
  • Next by thread: Re: Puzzled by IntegerPart