[chuck-users] std.abs always does floats

Graham Percival gpermus at gmail.com
Wed Oct 19 20:47:28 EDT 2005


Could std.abs detect if the variables are ints, and return an
int if so?

3 => int intfoo;
2 => int intbar;
std.abs(intfoo-intbar) => int foobar;

result:
[foo.ck]:line(3): cannot resolve operator '=>' on types 'float' and 
'int'...


It's not a big deal to add the $int, but it surprised me when I first
encountered it.

Cheers,
- Graham



More information about the chuck-users mailing list