Jul 27, 2009 at 6:36am
i understand and accept that and why expr %($f1) cannot work
maybe its just too simple for me, but i dont find a working
Jul 27, 2009 at 9:04am
Is that what you trying to achieve ? :
[ expr $f1-int($f1/$f2)*$f2 ]
Jul 27, 2009 at 7:26pm
Since fmod() is the standard C math function for floating-point modulo, one might expect [expr fmod($f1, $f2)] to work.
Of course, it doesn’t.
One could file a feature request for expr to support fmod() (or, better still, a % float-operator).
In the meantime, there’s Ch’s suggestion.
And, of course, the % object, which started supporting floats in an early Max 4 release.
Jul 27, 2009 at 7:48pm
thanks Ch, well hopefully you dont think i was just to lazy to
i have never made a float % abstraction myself (back in OS9
maybe i make one now.
but in this case i need stuff to work inside expr as this
actually it is suprising that [expr] does not support “fmod”
well, there will be a reason for it, we discussed the nature
Jul 28, 2009 at 7:01pm
Claiming “no one ever uses” any given function is just begging, pleading to be contradicted, isn’t it?
Frankly, I use natural log as often as any of the trig/log functions.
But more to the point is the rather idiosyncratic choices made by expr of which functions from the C math library to support and which to ignore. fmod() would definitely be useful.
Ideally, expr should support all the functions in ISO/IEC 9899:1999 that simply return a value. (ie, functions like frexp(double, int *) with a secondary return value as a pointer argument won’t fit into the expr paradigm).
Does Cycling 74 need an ‘official’ bug report to do anything about this?
Jul 31, 2009 at 1:12am
i just found out that
[expr $f1 % $f2]
is how it actually works!
thats already the second new thing i learned about expr/if
Jul 31, 2009 at 6:49am
What do you mean Roman?
[expr $f1 % $f2] outputs the same result as [expr $i1 % $i2],
by the way, a nice thing about expr that is stated in the reference :
Jul 31, 2009 at 5:23pm
you are right, it does not do float.
but the % sign alone was a surprise for me – i mainly asked
somehow i tend to think that everything which is fully
(like i said in the other thread the only additional “undocumented”
and i assume i would need to write c classes for that …
but i dont have time to discuss that now, as i am going to
You must be logged in to reply to this topic.