[chuck-users] devide issue?

Kassen signal.automatique at gmail.com
Wed May 10 03:59:38 EDT 2006


Graham;
> Note that you can get a float like this:
> 2 / 3.0 => float a;
> <<< a >>>;

Yes, I figured that out so it's not so bad.

It's not a huge issue even if both sides would be int type variables
because some temporary float variable will take care of it. It's
certainly not going to keep anyone from doing anything.

I wrote about it because I didn't expect it, it was tricky to find
because the division was a part of a larger calculation and there was
no documentation. I would be fine with it if it's deemed correct but
in that case I'd like to sugest a note about it in our documentation.
Three minutes with the manual would be much nicer then half a hour of
staring at the VM in disbelief. I almost thought I needed some
sleep...

Something like; "if both sides are integers devide will return a
integer, rounding down. If you need floats make sure at least one side
is a float, for example by using a decimal point or by using a
temporary variable" would be fine with me. Perhaps it might be better
to have a more general text about the type returned by the math
operations with a note that that might result in unexpected situations
with the devide? Currently I think only the modulo's example covers
floats.

Yours,
Kas.


More information about the chuck-users mailing list