[PD] Problem with lists and data
Mathieu Bouchard
matju at artengine.ca
Fri Sep 2 01:26:46 CEST 2011
On Thu, 1 Sep 2011, Thomas Mayer wrote:
> if (float_value == 0 && strcmp(string_value, "0") != 0) {
> SETSYMBOL(&out_data[1], gensym(string_value));
> } else {
> SETFLOAT(&out_data[1], float_value);
> }
> Now, it is working as intended. Is this the "standard" way in C to get
> possible floats out of strings?
It will not catch "-0".
I think that comparing pointers of strtof() is a safer bet... though "-0"
rarely happens.
_______________________________________________________________________
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
More information about the Pd-list
mailing list