• 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 13:29:00 +0200


Le 10 mai 2010 à 12:46, Mark J. Reed a écrit :

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...


In fact, the original code was :

set c to "9998765432"
set i to c as integer

With c grabbed from a csv file.

I got an error message.
It's when I saw this one which I introduced the 
set r to c as real
instruction and edited the original one as 
set i to r as integer 
to check if an error was issued.

I was really surprised to get no alert.
This feature bored me more than the value returned because this one make sense.

Yvan KOENIG (VALLAURIS, France) lundi 10 mai 2010 13:28:53


 _______________________________________________
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

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: "Mark J. Reed" <email@hidden>)

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