<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1250">


<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=296063818-08022007><FONT face=Arial 
color=#0000ff size=2>OK, this what I wanted:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=296063818-08022007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=296063818-08022007><FONT face=Arial 
color=#0000ff size=2>I have a value: a = 48.41</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=296063818-08022007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=296063818-08022007><FONT face=Arial 
color=#0000ff size=2>My lowValue is: lowValue = 48.35</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=296063818-08022007><FONT face=Arial 
color=#0000ff size=2>My highValue is : highvalue = 48.45</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=296063818-08022007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=296063818-08022007><FONT face=Arial 
color=#0000ff size=2>if a &lt;= lowValue:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=296063818-08022007>&nbsp;&nbsp;&nbsp; <FONT 
face=Arial color=#0000ff size=2>print 'value below limit'</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=296063818-08022007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=296063818-08022007><FONT face=Arial 
color=#0000ff size=2>if a &gt;= highValue:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=296063818-08022007>&nbsp;&nbsp;&nbsp; <FONT 
face=Arial color=#0000ff size=2>print value above limit'</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=296063818-08022007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=296063818-08022007><FONT face=Arial 
color=#0000ff size=2>I though that it could be possible to have a range between 
48.35 and 48.45 that could&nbsp;have a&nbsp;step&nbsp;of 0.1</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=296063818-08022007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=296063818-08022007><FONT face=Arial 
color=#0000ff size=2>This works fine with normal intgers:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=296063818-08022007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=296063818-08022007><FONT face=Arial 
color=#0000ff size=2><STRONG>&gt;&gt;&gt; def 
lookAtRange(a):<BR>...&nbsp;&nbsp;&nbsp;&nbsp; if a in range(40, 110, 
10):&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </STRONG>#Would like to have: if 
a in range(48.35, 48.45, 
0.1):<BR><STRONG>...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print 'In 
limits'<BR>...&nbsp;&nbsp;&nbsp;&nbsp; 
else:<BR>...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print 'Out of 
limits'<BR>...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&gt;&gt;&gt; 
lookAtRange(40)<BR>In limits<BR>&gt;&gt;&gt; lookAtRange(50)<BR>In 
limits<BR>&gt;&gt;&gt; <BR>&gt;&gt;&gt; lookAtRange(20)<BR>Out of 
limits<BR>&gt;&gt;&gt; <BR>&gt;&gt;&gt; lookAtRange(120)<BR>Out of 
limits<BR>&gt;&gt;&gt; </STRONG></FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=296063818-08022007>Johan</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><BR></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Andre Engels 
[mailto:andreengels@gmail.com] <BR><B>Sent:</B> 08 February 2007 07:17 
PM<BR><B>To:</B> johan@accesstel.co.za<BR><B>Cc:</B> 
tutor@python.org<BR><B>Subject:</B> Re: [Tutor] Range of float 
value<BR></FONT><BR></DIV>
<DIV></DIV>2007/2/8, Johan Geldenhuys &lt;<A 
href="mailto:johan@accesstel.co.za">johan@accesstel.co.za</A>&gt;:
<DIV><SPAN class=gmail_quote></SPAN>
<BLOCKQUOTE class=gmail_quote 
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
  <DIV>
  <DIV><SPAN><FONT face=Arial size=2>Hi all,</FONT></SPAN></DIV>
  <DIV><SPAN><FONT face=Arial size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN><FONT face=Arial size=2>I have a value that ranges between 48.01 
  and 48.57. a Float value in other words.</FONT></SPAN></DIV>
  <DIV><SPAN><FONT face=Arial size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN><FONT face=Arial size=2>I want to look at changes in the value. If 
  my normal range is between 48.35 and 48.45, how will I identify the value 
  below 48.35 and above 48.45?</FONT></SPAN></DIV>
  <DIV><SPAN><FONT face=Arial size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN><FONT face=Arial size=2>Something I tried was:</FONT></SPAN></DIV>
  <DIV><SPAN><FONT face=Arial size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN><FONT face=Arial size=2>for a in range(48.35, 
  48.45):</FONT></SPAN></DIV>
  <DIV><SPAN>&nbsp;&nbsp;&nbsp; <FONT face=Arial size=2>print 
  a</FONT></SPAN></DIV>
  <DIV><SPAN><FONT face=Arial size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN><FONT face=Arial size=2>It gives me a value of 
  100.</FONT></SPAN></DIV>
  <DIV><SPAN><FONT face=Arial size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN><FONT face=Arial size=2>Is it possible to get a range of a float 
  value?</FONT></SPAN></DIV></DIV></BLOCKQUOTE></DIV><BR>It depends. What would 
you like it to be? All numbers in that range? They're uncountably infinite, so 
no way we could ever get that out of the computer. All actual float values? 
Depends too much on the implementation of the specific machine you're working on 
to be workable. <BR><BR>Identifying values below 48.35 and above 48.45 is simply 
done by:<BR>if value &lt; 48.35 or value &gt; 48.45 then...<BR><BR>No need to 
first create the range of values<BR clear=all><BR>-- <BR>Andre Engels, <A 
href="mailto:andreengels@gmail.com">andreengels@gmail.com</A><BR>ICQ: 
6260644&nbsp;&nbsp;--&nbsp;&nbsp;Skype: a_engels <BR>
<P><FONT size=2>--<BR>No virus found in this incoming message.<BR>Checked by AVG 
Free Edition.<BR>Version: 7.5.432 / Virus Database: 268.17.30/674 - Release 
Date: 2007/02/07 03:33 PM<BR></FONT></P></BODY></HTML>
<BR>

<P><FONT SIZE=2>--<BR>
No virus found in this outgoing message.<BR>
Checked by AVG Free Edition.<BR>
Version: 7.5.432 / Virus Database: 268.17.30/674 - Release Date: 2007/02/07 03:33 PM<BR>
</FONT> </P>