<html>
<head>
<base href="http://bugzilla.scilab.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:sgougeon@free.fr" title="Samuel GOUGEON <sgougeon@free.fr>"> <span class="fn">Samuel GOUGEON</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - Comparison with booleans may have a wired behaviour. -->[%t %f] == [%t %f] an"
href="http://bugzilla.scilab.org/show_bug.cgi?id=6703">bug 6703</a>
<br><br>
---------- Bug Summary ----------- <br>Comparison with booleans may have a wired behaviour. -->[%t %f] == [%t %f] an <br><br>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">URL</td>
<td>None. Comparison is just wrong.
</td>
<td>
</td>
</tr>
<tr>
<td style="text-align:right;">Assignee</td>
<td>bruno.jofret@scilab-enterprises.com
</td>
<td>bugzilla.admin@scilab.org
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Comparison with booleans may have a wired behaviour. -->[%t %f] == [%t %f] an"
href="http://bugzilla.scilab.org/show_bug.cgi?id=6703#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Comparison with booleans may have a wired behaviour. -->[%t %f] == [%t %f] an"
href="http://bugzilla.scilab.org/show_bug.cgi?id=6703">bug 6703</a>
from <span class="vcard"><a class="email" href="mailto:sgougeon@free.fr" title="Samuel GOUGEON <sgougeon@free.fr>"> <span class="fn">Samuel GOUGEON</span></a>
</span></b>
<pre>In Scilab 6.0:
Still:
-->[%t %f] == [1 0]
ans =
F
This is because both sides not having the same type, they are compared as whole objects.
%s_o_b() and %b_o_s() return always r=%f.
All numerical types are comparable, but not with booleans.
Why isn't there any equivalence %t<=>~=0 and %f <=> ==0 ?
..
Still we have
<span class="quote">>-->[%t %f] == [int8(1) int8(0)]
> ans =
> F T</span >
This is definitely weird, indeed. Since [%t %f] and [int8(1) int8(0)]
have not the same types, they should be compared as some whole objects
as in [%t %f] == [1 0], and so should return %F ...</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>