Re: magic integer converter number 62?
Re: magic integer converter number 62?
- Subject: Re: magic integer converter number 62?
- From: "Arthur J Knapp" <email@hidden>
- Date: Wed, 21 Feb 2001 11:56:21 -0500
>
Date: Mon, 19 Feb 2001 17:36:01 -0800 (PST)
>
From: =?iso-8859-1?q?M=20Shaw?= <email@hidden>
>
Subject: magic integer converter number 62?
>
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
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
--
{
Arthur J Knapp, of STELLARViSIONs ;
http://www.STELLARViSIONs.com ;
mailto:email@hidden ;
http://developer.apple.com/techpubs/
macos8/InterproCom/AppleScriptScripters/
AppleScriptLangGuide/
}