Re: magic integer converter number 62? - Joking???
Re: magic integer converter number 62? - Joking???
- Subject: Re: magic integer converter number 62? - Joking???
- From: Ed Stockly <email@hidden>
- Date: Thu, 22 Feb 2001 00:04:12 -0800
>
Can anybody figure out why this works:
>
set x to 62
>
set b to ((x + (2.6 - (2.6 mod 1))) - x) as integer
>
>
and this doesn't:
>
set x to 61
>
set b to ((x + (2.6 - (2.6 mod 1))) - x) as integer
>
(2.6 - (2.6 mod 1)) as integer
>
--> Can't make 2.0 into an integer
What am I missing here? All three correctly return the value of 2 on my mac
: \
Now, if we remember our 'new math' it shouldn't matter what value you give
x. It is added then subtracted from the equation and, since addition is
commutative, it should have no net effect on the result. In both cases the
value of b must be:
(2.6 - (2.6 mod 1))
Which is 2.
Have you tried it in Script Editor? Could there be an Osax interfereing
with the numeric coercion? Is it possible I have an Osax that facilitates
the coercion?
ES?
*would not be surprised if I'm not getting the joke or missing something
rather obvious*
: {
-- <
http://justapplescript.weblogs.com/>
-- <
http://justapplescript.weblogs.com/AppleScriptLearningResources>
-- Feedback welcome, join today!