Subject: | |
From: | |
Reply To: | |
Date: | Fri, 16 May 2003 14:12:27 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
At 07:15p +0200 05/16/2003, Emmanuel didst inscribe upon an electronic papyrus:
>At 10:22 AM -0400 16/05/03, Ethan Rips wrote:
> >On 5/15/03 10:39 PM, Nigel Garvey <[log in to unmask]>
> >wrote:
> >
> > > 1.5 as double integer
> > > --> 2.0
> >
> >OMM (running 10.1.5) the result is 1.0. Does this behavior change depending
> >on one's version of Applescript?
>
>LOL!
>
>I confirm, here 10.1.6 yields 2.0.
>
>10.1.5 has definitely been a strange thing.
>
>Emmanuel
Is unexpected behavior of an unsupported coercion considered a bug?
I guess nobody's tried '1.5 as integer' lately.
The double integer is not a real, it is a double integer. Remember
that AppleScript often rounds terms off (e.g., text -> string), so
just because it tells you that a double integer is a real does not
make it so.
Moral: round any decimal numbers yourself before coercing to double.
Here are some class codes for numbers:
«class nmbr» = number
«class shor» = short integer
«class long» = integer
«class magn» = unsigned integer
«class comp» = double integer
«class doub» = real
«class exte» = extended real
-boo
|
|
|