[PD] float parsing
Tim Blechmann
tim at klingt.org
Fri Dec 29 01:36:40 CET 2006
> > This demonstrates that unary + works in front of numerical literal,
> > both in the main language and in the preprocessor. I don't know of
> > a way to test whether the last + before the 1 is actually
> > considered part of the literal or not. However, both scanf() and
> > strtod() consider + as part of a float literal (was there ever a
> > time that they didn't? really?).
>
> What would be the advantages/disadvantages of either way? My
> intuition says that +1 should be a symbol, perhaps because it is
> rare to write positive numbers in math with a leading +.
well, pd is not the only program, that has to handle string to float
conversions ... most parsers i know, would allow a leading '+' char for
parsing floats ...
> Maybe the errant newbie might be confused when +1 turns out to be a
> symbol. But if Pd starts removed + signs upon save, then that could
> also be annoying.
maybe the newbie is confused by +1 being a symbol? or, if he's not
confused by +1 being a symbol, then probably by 1e+2, being a float ..
t
--
tim at klingt.org ICQ: 96771783
http://www.mokabar.tk
There's no such entity as "most people". These are generalities. All
generalities are meaningless. You've got to pin it down to a specific
person doing a specific thing at a specific time and space.
William S. Burroughs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20061229/f987b1bc/attachment.pgp>
More information about the Pd-list
mailing list