<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
On 12/15/2010 01:47 PM, Frédéric Mabille wrote:
<blockquote
cite="mid:366F5457-0D8D-4982-A7EB-4468ACE054D2@supagro.inra.fr"
type="cite">Hi,
<div><br>
</div>
<div>During the computation of my program, my function "if" produce a
strange result.</div>
<div>I fact, after many investigations, I have observed a very
surprising result.</div>
<div><br>
</div>
<div><i>for i = 1:10</i></div>
<div><i>test = .4*i - 1.2 ;</i></div>
<div><i>if test == 0 then ...</i></div>
<div><br>
</div>
<div>But when i = 3, scilab give me : test = %eps = -2.220D-16
<> 0 !!!</div>
<div>It is really awkward.</div>
<div><br>
</div>
<div>Could someone have a simple solution ?</div>
<div>Thx </div>
<div><br>
</div>
<div>
<div><span class="Apple-style-span"
style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span
class="Apple-style-span"
style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<div style="word-wrap: break-word;">
<div><span class="Apple-style-span" style="font-size: 12px;">
<div><font class="Apple-style-span" face="Times"><span
class="Apple-style-span" style="font-family: Times;">Frédéric </span></font></div>
</span></div>
</div>
</span></span></div>
</div>
</blockquote>
Hi dont know with scilab, but with matlab you should not mix i (index)
with i (complex number)<br>
</body>
</html>