floating point modulo in expr?

Oct 18, 2006 at 6:26pm

floating point modulo in expr?

hi,

shouldn’t it be possible to use % in expr more or less the same way
as in the % object – with floats?

thanks,

jan

#28237
Oct 20, 2006 at 12:29am

Apologies if you’re making an observation and not asking for a solution, but as it doesn’t work, and possibly never will do because modulo arithmetic is for integers only, you can do this to get the remainder of a float division in expr:

[expr $f1 - ($f2 * int($f1 / $f2))]

Regards

Alex

#86513

You must be logged in to reply to this topic.