MathGroup Archive 1999

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

Search the Archive

Re: Number Formatting

  • To: mathgroup at smc.vnet.net
  • Subject: [mg17719] Re: [mg17714] Number Formatting
  • From: Jean-Marie Thomas <jmthomas at agat.net>
  • Date: Tue, 25 May 1999 02:15:09 -0400
  • Organization: TeA
  • References: <199905230625.CAA01145@smc.vnet.net.>
  • Sender: owner-wri-mathgroup at wolfram.com

N is an operator used to convert expressions to numerical quantities, it is not
meant to display these; as mentioned, NumberFrom is the right command for that.

Mind the fact that NumberForm uses exponent functions too. If you want no
exponent, uses
NumberFrom[...,ExponentFunction->(Null&)]

On Sun, 23 May 1999, David Park wrote:
> MathGroup,
>
> Sometimes I like to use N to set the display precision of a number.
> However it seems to have strange behavior.
>
> TableForm[Table[N[248713.11673961558`, i], {i, 1, 9}]]
> 300000.
> 250000.
> 249000.
> 2.487 x 10^5
> 2.4871 x 10^5
> 248713.
> 248713.1
> 248713.12
> 248713.117
>
> Why is the first entry rounded the wrong way? Why the switch into and
> out of exponent format? Except for the first three entries one might
> say it only shows the number of digits in the precision. But then why
> not use exponent notation for the first three entries also?
>
> When NumberForm is used instead of N, the rounding is correct, there
> are no exponent forms used, and there are NumberForm::sigz warning
> messages when there are trailing nonsignificant zeros.
>
> Is the lesson that N is not really meant for number formatting, and
> N[expr, 1] should never be used? In some fields, one place precision
> is quite respectable!
>
> David Park
> djmp at earthlink.net
> http://home.earthlink.net/~djmp/



  • Prev by Date: Solving large (500x500) system of lin.eqs. in Mathematica
  • Next by Date: Re: Repost: Solve: same or new bug?
  • Previous by thread: Number Formatting
  • Next by thread: RE: Number Formatting