Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Expressions with mixed types including low-level types

6 views
Skip to first unread message

Geoffrey Broadwell

unread,
Feb 27, 2007, 12:20:30 PM2/27/07
to p6l
How is casting and coersion handled with expressions involving mixed low
and high level types?

For example, what is the output of this?

my Int $ten = 10;
my int4 $a = 0;
my int4 $b;

$b = ($a + 2.4 * $ten) / 4;
say $b;

The answers to the above questions may alter my view on the proper
handling of overflow during casting/coersion.


-'f


Geoffrey Broadwell

unread,
Feb 27, 2007, 12:35:49 PM2/27/07
to p6l

And for those who think the above code is too easy -- and I can see at
least 1, 2, 5, and 6 as defensible answers -- try 2.8 instead of 2.4.


-'f


Larry Wall

unread,
Feb 27, 2007, 7:11:42 PM2/27/07
to p6l
On Tue, Feb 27, 2007 at 09:35:49AM -0800, Geoffrey Broadwell wrote:

I think either 5 or 6 is correct. See the recent S09 update.

Larry

0 new messages