#670 [range] and [maxlib/scale] broken

v0.42
open
nobody
5
2013-11-11
2011-03-21
sistisette
No

[range A B C D] and [maxlib/scale A B C D] don't behave correctly when either A>B or C>D or both.

If they are not supposed to (which I don't see a good reason why), then they should at the very least print an error message, rather than output any unpredictable value.

When only C>D but A<B, the output seems to range from C to max(D,1) instead of from C to D.
When A>B, the result doesn't make any sense.

By the way wouldn' it be better to implement these objects as abstractions?

Discussion

  • sistisette

    sistisette - 2011-03-21
    • labels: --> pd-extended
    • milestone: --> v0.42
     
  • sistisette

    sistisette - 2011-03-21

    "When only C>D but A<B, the output seems to range from C to max(D,1) instead of from C to D."

    No, it's a bit more perverse than that. When A<B and D=0 (regardless of the value of C), the output ranges from C to 1 instead of from C to 0. For any other value of D (provided that A<B) it behaves correctly.

    So [range A B C D] doesn't behave correctly when any of the following hold:
    1) A>B => garbage output
    2) D=0 => behaves as if D=1

     
  • pappo

    pappo - 2013-11-11

    Any news in this regard?
    It's a shame such a useful object doesn't work at its full potential

     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks