Re: magic integer converter number 62?
Re: magic integer converter number 62?
- Subject: Re: magic integer converter number 62?
- From: Kevin Windham <email@hidden>
- Date: Wed, 21 Feb 2001 11:20:16 -0600
I also get an error that says can't make 2.0 into an integer. The difference
for me is that the x+result and result-x lines return reals 64.0 and 2.0
respectively. In the first scenario, the result as integer coerces correctly
and returns 2. In the second scenario I get the error and 2.0 will not
coerce. I'm puzzled and have no idea why this doesn't work.
I'm using 9.1 with AS 1.5.5
>
In what sense does the second statement not work? I don't
>
get an error, and I don't know what it is that you are trying
>
to do.
>
>
In any case, have you examined it step by step? Just break
>
the parentheses apart:
>
>
set x to 62
>
-- set b to ((x + (2.6 - (2.6 mod 1))) - x) as integer
>
>
2.6 mod 1 --> 0.6
>
2.6 - result --> 2.0
>
x + result --> 64
>
result - x --> 2
>
result as integer --> 2
>
>
set x to 61
>
-- set b to ((x + (2.6 - (2.6 mod 1))) - x) as integer
>
>
2.6 mod 1 --> 0.6
>
2.6 - result --> 2.0
>
x + result --> 63
>
result - x --> 2
>
result as integer --> 2