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

MathGroup Archive 2007

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

Search the Archive

Re: Rescale scales lower bound wrong

  • To: mathgroup at smc.vnet.net
  • Subject: [mg74336] Re: Rescale scales lower bound wrong
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Mon, 19 Mar 2007 02:00:29 -0500 (EST)
  • Organization: The Open University, Milton Keynes, UK
  • References: <etijg2$is4$1@smc.vnet.net>

zac wrote:
> Dear Group,
> 
> is there anything smart to be said concerning the following code?
> 
> In[1]:= Rescale[0.09090909090909091,{0.09090909090909091,1.},{0,100}]
> 
> Out[1]= -1.7763568394002505`*^-15
> 
> In[2]:= myRescale[y_,{minY_, maxY_},{minX_,maxX_}]:=N[(maxX-minX)/
> (maxY-minY)*(y- minY)+minX];
> 
> In[3]:= myRescale[0.09090909090909091,{0.09090909090909091,1.},
> {0,100}]
> 
> Out[3]= 0.
> 
> In my intention, the first result is wrong (apart from the actual
> value, it is a negative number!), and the second one is correct. Is
> the first result due to the internal number-representation?

Yes.

In[1]:=
Chop[Rescale[0.09090909090909091, {0.09090909090909091, 1.}, {0, 100}]]

Out[1]=
0

Regards,
Jean-Marc


  • Prev by Date: Re: Two successive FindMinimum -> Bug?
  • Next by Date: Re: Keyboard shortcut to select the entire cell
  • Previous by thread: Rescale scales lower bound wrong
  • Next by thread: Keyboard shortcut to select the entire cell