• Long (!!) number to symbol...?!

Its not like I don't know how to convert "ordinary" numbers into symbols,
but whats about a long number like "1234567890"...?!?
Before I can convert it, it becomes rounded...
So all I end up with is:
"symbol 1.23457e+009"

E.g. imagine you want Pd to operate on a given text with (long!) phonenumbers in it...
Phonenumbers are rather a "name" than a mathematically useful number ...I guess only freaks round phonenumbers... crazy Pd...
Wouldn't it be great to tell the program what is what, and not vice versa?!?
(...IF there is a system behind it, one maybe should find out where exactly numbers become rounded...)

Is there anyone who can "uncripple" this?!

Flipp

• Posts 4 | Views 4118
• There are two potential problems with long numbers:

1. The 32-bit float format gets less accurate with very high numbers. The highest integer you can represent, for example, is 2^24. After that, integers get skipped.

2. I believe that fact that Pd represents long numbers in scientific format is a "feature." I personally hate it. I think the only way to change that is to modify the source.

Depending on how you are generating the number, you could try to represent them as groups of smaller numbers. For example, if you have 1234567890, you could represent each digit as a power of ten in a list, like [1 2 3 4 5 6 7 8 9 0(. Then use [list2symbol] to convert it. That could be a mathematical pain in the ass, though, depending on how you're going about it.

I suppose there could be a way of doing that with bitwise operators to make a list of powers-of-two.

• ...Oh dude...; even the numbers in comments are crippled when you copy/paste them or save and load the patch. -For this there can really be no sensible reason so this must be a very deep problem indeed...

Nope, I'm reading from a predefined text like a textfile so in general I can't tweak this situation "manually" here... The digit-thing would only work if I can get these numbers out of the textfile in one piece and after that convert them to lists, but I guess if that works I don't have to do the digit-thing anymore...

An easy was out of this would be to replace the anyways rather useless "feature" of the [symbol] to convert numbers into "symbol float" insteasd of "symbol 1234567890", because detecting if a "thing" is a float is simply possible by using other vanilla-objects ( like: [route float]---( **)---[symbol float] would produce the same output...)

Flipp**

• Well, unfortunately, it isn't actually a "feature" of [symbol] itself. It's across the board in Pd. So it's not such an easy way out.

If you're using a textfile, one possible solution is to open the file in a text editor and stick a non-numeric character at the beginning of each number. You might be able to do this quickly with the "Find and Replace" feature (I just tried using Smultron, and it works using regular expressions; find "^" and replace with "_", or whatever you want). By doing this, Pd will then interpret them as symbols. Then you might be able to get what you want by doing this:

[textfile] [symbol( <-- this will break it up into individual characters
| |
[symbol2list]
|

|
[list2symbol]

Posts 4 | Views 4118
Internal error.

Oops! Looks like something went wrong!