[chuck-users] std.abs always does floats
Ge Wang
gewang at CS.Princeton.EDU
Fri Oct 21 04:24:04 EDT 2005
Hi Graham and all!
As you may have seen on the main 'chuck' list, 1.2.0.3 is released and
we have hopefully resolved this issue.
std.abs is for int
std.fabs is for float
Sorry for the API changes. Also, sorry for the mountain of spam you
are about to receive...
Best,
Ge!
On Oct 19, 2005, at 8:47 PM, Graham Percival wrote:
> 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
>
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
More information about the chuck-users
mailing list