[PD-dev] [float infinity] and [float -infinity]
Hans-Christoph Steiner
hans at eds.org
Tue Jan 31 16:04:16 CET 2006
On Jan 29, 2006, at 11:15 PM, Mathieu Bouchard wrote:
> On Sun, 29 Jan 2006, Hans-Christoph Steiner wrote:
>
>> [1 0(---[/], [-1 0(---[/], [0 0(---[/], and [2 666(---[pow] don't work
>> because they output "inf" and "-inf", and you can't do operations on
>> them, like comparing them with [moses].
>
> The first three currently give "0", a special case hardcoded into [/].
> IEEE-compliance would mean that they would give +infinity, -infinity
> and
> NaN, respectively. The fourth one currently gives infinity and is
> IEEE-compliant.
>
> In the IEEE float system, infinities are comparable. Of all comparable
> numbers, +infinity is the greatest, and -infinity is the least.
> Infinities
> are [moses]-safe.
>
> NaN is the only non-comparable number. Any comparison with it yields
> 0. It
> isn't even equal to itself. You can use NaN with [moses] but it breaks
> the
> usual expectations about how [moses] works.
Apparently Pd is not alone in its lack of IEEE 754 compliance, python
uses the OS-specific values, which are not always the same:
http://www.python.org/peps/pep-0754.html
>> And I do not think that all math objects should support these. [float
>> infinity] would output the float value of FLT_MAX, and then the math
>> objects would use that value.
>
> If you don't want infinities to be supported, even though they _are_
> comparable, please don't call FLT_MAX "infinity", just call it "max".
Why? I think this would be confused with [max] and [min]. I think
that we can make things close to IEEE style with much less work by
doing [float infinity], etc.. Plus IEEE names are "PosInf", "NegInf",
and "NaN", so [float infinity] and [float -infinity] and [float
not_a_number] are obviously different.
>
>> IEEE-compliance sounds good. Feel like submitting some patches?
>
> My pinky toe tells me that if Miller has decided to put extra code in
> order to break IEEE-compliance, that it will be extra hard to make him
> remove it. I don't think that you'd be in favour of IEEE-compliance
> either, considering what you have said in the last two mails.
I am just discussing the options. I said I supported it, and that's
what I mean. I don't need an interpreter on the list :-P. But it
doesn't mean that I support it without discussion.
.hc
________________________________________________________________________
____
As we enjoy great advantages from inventions of others, we should be
glad of an opportunity to serve others by any invention of ours; and
this we should do freely and generously.
- Benjamin Franklin
More information about the Pd-dev
mailing list