Processing 1.5.1: unbinary() Does Not Like Negatives
in
Programming Questions
•
10 months ago
Ok I have not yet migrated to version 2 but for those of us still on an earlier version, I was playing around with the unbinary() function (
http://processing.org/reference/unbinary_.html ) and noticed that - unlike the binary() function, unbinary() only seems to work with positive numbers.
To see what I mean, take the following code and run it. It will die (though the binary() command works just fine if you comment out lines 4 and 5. Make the number in line 1 positive and the program works just fine.
Best Regards, Jim
To see what I mean, take the following code and run it. It will die (though the binary() command works just fine if you comment out lines 4 and 5. Make the number in line 1 positive and the program works just fine.
- int nnn = -1234;
- String bc = binary(nnn);
- println(bc);
- int newn = unbinary(bc);
- println(newn);
Best Regards, Jim
1