[PD] Using large numbers with [text set]

Matt Barber brbrofsvl at gmail.com
Thu Oct 6 21:50:07 CEST 2016


It's happening because that number overflows the capacity of a 32-bit int
(2^31-1) when cast from the float you send. What it does when you overflow
an int when casting from float is undefined in C, I'm pretty sure, but here
it just sets it to the lowest possible value. You'll probably get the same
result if you run the large float through an [int].

On Thu, Oct 6, 2016 at 1:35 PM, Liam Goodacre <liamg_uw at hotmail.com> wrote:

> The help file for [text set] instructs us to use large numbers for the
> second inlet (ie. 1e+006) to append a line of text. But for numbers above
> 1e+010, it seems to stop working, giving the error message:
>
>
> text set: line number (-2147483648) < 0
>
>
> I wouldn't call this much of a problem as I don't imagine that anyone
> needs to append more than 10,000,000,000 lines of text. But I am curious,
> why would this large number be interpreted as a negative?
>
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> https://lists.puredata.info/
> listinfo/pd-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20161006/2a9f1c13/attachment.html>


More information about the Pd-list mailing list