• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: String to real conversion question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: String to real conversion question


  • Subject: Re: String to real conversion question
  • From: Yvan KOENIG <email@hidden>
  • Date: Mon, 10 May 2010 16:35:23 +0200


Le 10 mai 2010 à 16:05, Michelle Steiner a écrit :

On May 10, 2010, at 3:13 AM, Yvan KOENIG 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*) 

I get

error "Can’t make 9.998765432E+9 into type integer." number -1700 from 9.998765432E+9 to integer

Snow Leopard 10.6.3.


Hello

It become really puzzling.

at 12:46:37, Mark J. Reed wrote :

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*)

Are you running Applescript or Smile ?

As my daughter is back, I was able to run under 10.6.3 with AppleScript 2.1.2, Editor 2;3 (118)
I got :
(*9.998765432E+9*)
(*1.40883084E+9*)

Yvan KOENIG (VALLAURIS, France) lundi 10 mai 2010 16:34:27


 _______________________________________________
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

  • Follow-Ups:
    • Re: String to real conversion question
      • From: Michelle Steiner <email@hidden>
References: 
 >RE: String to real conversion question (From: Scott Babcock <email@hidden>)
 >Re: String to real conversion question (From: Yvan KOENIG <email@hidden>)
 >Re: String to real conversion question (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: String to real conversion question
  • Next by Date: Re: String to real conversion question
  • Previous by thread: Re: String to real conversion question
  • Next by thread: Re: String to real conversion question
  • Index(es):
    • Date
    • Thread