[chuck-users] std.abs always does floats
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, 220.127.116.11 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...
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;
> [foo.ck]:line(3): cannot resolve operator '=>' on types 'float' and
> It's not a big deal to add the $int, but it surprised me when I first
> encountered it.
> - Graham
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
More information about the chuck-users