<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 2018-09-30 10:15, David Mertz wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAEbHw4YE1p2E8b+G7otuAfCqJqkMXh9FmHRyQfShWa1+aqzY6g@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<div dir="ltr">For similar reasons, I'd like an iInf too, FWIW.
It's good for an overflow value, although it's hard to get there
in Python ints (would 'NaNAwareInt(1)/0' be an exception or
iInf?). Bonus points for anyone who knows the actual maximum
size of Python ints :-).
<div><br>
</div>
<div>However, the main use I'd have for iInf is simply as a
starting value in a minimization loop. E.g.</div>
<div><br>
</div>
<blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<div><font face="monospace, monospace">minimum =
NaNAwareInt('inf')</font></div>
<div><font face="monospace, monospace">for i in the_data:</font></div>
<div><font face="monospace, monospace"> minimum = min(i,
minimum)</font></div>
</blockquote>
<blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<div><font face="monospace, monospace"> other_stuff(i,
minimum, a, b, c)</font></div>
</blockquote>
<div><br>
</div>
<div>I've written that code a fair number of times; usually I
just pick a placeholder value that is "absurdly large relative
to my domain", but a clean infinity would be slightly better.
E.g. 'minimum = 10**100'.<br>
</div>
</div>
</blockquote>
<br>
If we conceptualize iNan as "not an integer", then we can define
operators in two manners:<br>
<br>
Let <code>●</code> be any operator:<br>
<br>
1) "conservative" - operators that define a<code> ● </code>b==iNaN
if either a or b is iNan<br>
2) "decisive" - operators that never return iNan<br>
<br>
With a decisive min(a, b), you can write the code you want without
needing iINF<br>
<br>
<br>
<br>
</body>
</html>