RE: The N function and precision
- To: mathgroup at smc.vnet.net
- Subject: [mg37413] RE: [mg37409] The N function and precision
- From: "David Park" <djmp at earthlink.net>
- Date: Sun, 27 Oct 2002 06:33:09 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Ray, The behavior of N definitely changed between Version 3 and Version 4. Basically, the purpose of N is to change exact expressions to approximate number expressions. N has nothing directly to do with the display precision. To directly control the display precision use NumberForm. Machine precision approximate numbers, since Version 4, are displayed with 6 places. This can be changed through the Option Inspector. When you use N to convert Pi, say, to an approximate number, it uses machine precision if k <= 16. Otherwise, it uses an extended precision number and those numbers are displayed with the extended precision. So basically 1) Use N to convert exact expressions to approximate number expressions. 2) Use NumberForm to specifically control the display of numbers. 3) Use the Option Inspector to change the default display precision of machine precision numbers. David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: Ray [mailto:rayfg at optonline.net] To: mathgroup at smc.vnet.net In version 3.0 when I enter N[Pi,8], I get an output of 3.1415927 but the same input in version 4.2 gives an output of 3.14159. In fact, in version 4.2, N[Pi,k] for k between 0 and 16 gives an output of 3.14159 rather than a result with k digit precision. However, if k is 17 or more, I do get k digit precision in version 4.2. What happened to the "k" in N[expres,k] for k smaller than 17 in version 4.2. I have observed this in all calculations in Mathematica as I switched my lessons from 3.0 to 4.2. My students have reported the same problem. How do we get k digit precision for k smaller than 17 in version 4.2 Thanks.