#440 change float to t_float in Pd 'extra'

pending-accepted
puredata (375)
7
2012-12-15
2011-11-15
Katja
No

0001-change-float-to-t_float-in-Pd-extra.patch converts instances of 'float' to 't_float' in all classes of vanilla Pd's 'extra'. Also, a few constants and literals are defined with more decimals, and some float suffixes removed. The patch is intended for Pd-043.1test5.

Type 't_float' is already used in most of pd core code. The changes in the 'extra' classes would make them compliant with the core in this sense.

Discussion

  • Katja
    Katja
    2011-11-15

    Accompanying the patch file, I've produced unit test patches. The reference was pd-043.1 vanilla release. The tests indicate slightly altered output for some of the classes, probably due to more precise constants and removal of float suffixes. See attached 'unittests-pdextras.zip'.

     
  • Katja
    Katja
    2011-11-15

    correction: the reference for the unit test patches was pd-0.43.0 vanilla release

     
  • These changes would complete the t_float/t_sample clean up that happened with the core back in 0.42 (I think). I think it should be included in 0.43 if possible.

    Katya, how can we see what those differences are?

     
  • Katja
    Katja
    2011-11-15

    The more precise constants and removal of float suffixes originate from my attempts to make Pd work in single and double precision. Maybe I should make a patch file without these changes for the moment, till I've reviewed them better.

    Hans I do not understand your question 'how can we see what those differences are?' If you build a patched Pd-0.43.1test5 and run the tests which are also attached below, you'll see that the differences are in the analysis objects, notably bonk~.

     
  • i guess the question is: are the differences an _improvment_ of the situation (e.g. because [bonk~] historically produced slightly "off" values and the patch now fixes that)?

    in this case i think one could argue, that your patch is fixing a minor bug, and should be applied, even if it breaks 100% compatibility (and then: if somebody relies on an exact value output in float-domain, they should re-think their patch anyhow)

     
  • Katja
    Katja
    2011-11-16

    I've checked the case of bonk~ once more because the difference was remarkable there (that is, in terms of a test situation). It is fully due to a more precise definition of pi, 3.141592653589793 instead of 3.14159. Since a literal without float suffix is a double anyway, 3.14159 for pi is a waste of precision even when t_float is float. And even when this waste is considered unimportant, a more precise definition can not spoil the intended calculation result.

    So to answer IOhannes' question: the differences can be considered an improvement (albeit probably an unimportant one) of the situation. In practice, no one will be dependent on an exact output of bonk~, it is even quite hard to create a reproducible test situation. The same holds for fiddle~ and sigmund~. In this sense, the patch can be safely applied as is.

    By the way, the test patches can be opened to see results in detail, they're not dependent on a script to run them.

     


Anonymous


Cancel   Add attachments