Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1995
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1995

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

Search the Archive

Re: "unChopping" oddity

  • To: mathgroup at christensen.cybernetics.net
  • Subject: [mg723] Re: "unChopping" oddity
  • From: rubin at msu.edu (Paul A. Rubin)
  • Date: 11 Apr 1995 20:18:25 GMT
  • Organization: Michigan State University

In article <3md0p3$830 at news0.cybernetics.net>,
   Preston Nichols <pdn at godel.math.cmu.edu> wrote:
->Dear mathgroup:
->
->I have encountered some strange behavior (session below) in which  
->Graphics3D seems to introduce 15 "new" significant digits in some  
->coordinates.  The session below is from version 2.2 for SPARC, but I  
->also got exactly the same behavior from version 2.0 for NeXT.
->
->Can anyone else reproduce this?  What do you make of it?
->
->Preston Nichols
->Department of Mathematics
->Carnegie Mellon University
->
->----------------------------------------------
->unix18 1 $ math
->Mathematica 2.2 for SPARC
->Copyright 1988-93 Wolfram Research, Inc.
-> -- Terminal graphics initialized --
->
->In[1]:= myline = Line[{{0, 0, 0}, {1, 0, 0}}];
->
->In[2]:= divide[{a_,b_}] := Table[(1-t) a + t b, {t,0,1,0.2}]
->
->General::spell1:
->   Possible spelling error: new symbol name "divide"
->     is similar to existing symbol "Divide".
->
->In[3]:= Map[divide,Graphics3D[myline], {2,2}]//InputForm
->
->Out[3]//InputForm=
->  Graphics3D[Line[{{0, 0, 0}, {0.2, 0, 0}, {0.4, 0, 0},
->     {0.6000000000000001, 0, 0}, {0.8, 0, 0}, {1., 0, 0}}]]
->
->In[4]:= Map[divide,myline]
->
->Out[4]= Line[{{0, 0, 0}, {0.2, 0, 0}, {0.4, 0, 0}, {0.6, 0, 0},  
->{0.8, 0, 0}, {1., 0, 0}}]
->
->In[5]:= %//Graphics3D//InputForm
->
->Out[5]//InputForm=
->  Graphics3D[Line[{{0, 0, 0}, {0.2, 0, 0}, {0.4, 0, 0},
->     {0.6000000000000001, 0, 0}, {0.8, 0, 0}, {1., 0, 0}}]]

It's the same in kernel 2.2.2 under Windoze, but I don't think it has 
anything to do with Graphics3D.  I think it's just normal rounding.  Your 
argument t is being treated as a machine precision number.  My guess is 
that Mma handles the iterator in the Table by repeatedly adding .2 to it, 
and after three additions the accumulated rounding error is enough to make 
the last bit wobble:

In[1]:=  Table[t, {t,0,1,.2}] // FullForm
Out[1]=  List[0, 0.2, 0.4, 0.6000000000000001, 0.8, 1.]

Paul

**************************************************************************
* Paul A. Rubin                                  Phone: (517) 432-3509   *
* Department of Management                       Fax:   (517) 432-1111   *
* Eli Broad Graduate School of Management        Net:   RUBIN at MSU.EDU    *
* Michigan State University                                              *
* East Lansing, MI  48824-1122  (USA)                                    *
**************************************************************************
Mathematicians are like Frenchmen:  whenever you say something to them,
they translate it into their own language, and at once it is something
entirely different.                                    J. W. v. GOETHE


  • Prev by Date: ListSphericalPlot???
  • Next by Date: How do you input a solution from FindRoot into another equation?
  • Previous by thread: Re: "unChopping" oddity
  • Next by thread: Mathematica on IBM AIX 4.1.2