Re: String to real conversion question
Re: String to real conversion question
- Subject: Re: String to real conversion question
- From: "Mark J. Reed" <email@hidden>
- Date: Mon, 10 May 2010 06:46:37 -0400
Similar result under 10.6.3, but the result of truncating the number is different. Where you just got the maximum integer value (2^31-1), I got the original number modulo 2^31:
(*9.998765432E+9*)
(*1.40883084E+9*)
(1,408,830,840 is the remainder when 9,998,765,432 is divided by 2,147,483,648).
It does seem like there should be some sort of warning at least...
On Mon, May 10, 2010 at 6:13 AM, Yvan KOENIG
<email@hidden> wrote:
Funny behaviour under 10.4.11
run this short script :
set c to "9998765432"
set r to c as real
set i to r as integer
log r
log i
I assumed that I will get an error message because the number is too big for an integer bu I got this report :
(*9.998765432E+9*)
(*2.147483647E+9*)
Yvan KOENIG (VALLAURIS, France) lundi 10 mai 2010 12:13:06
I
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
--
Mark J. Reed <
email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden