• 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 sum
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: String to sum


  • Subject: Re: String to sum
  • From: Martin Orpen <email@hidden>
  • Date: Tue, 12 Oct 2004 21:04:30 +0100

Title: Re: String to sum
on 12/10/04 5:47 pm, Paul Berkowitz at email@hidden wrote:

> These will be a lot faster than run string.

I still rate using bc as the fastest way of doing this:

set
biglist to {}
set
opList to {"*", "+", "/", "-"}
repeat 100 times
   set end of
biglist to random number from 1 to 100
   set end of
biglist to some item of opList
   set end of biglist to "0"
end repeat
set
n to do shell script "echo \"scale=8 \n" & (biglist as string) & "\" | bc -s2"
n


Regards

--
Martin Orpen
Idea Digital Imaging Ltd -- The Image Specialists
http://www.idea-digital.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: String to sum
      • From: Mr Tea <email@hidden>
    • Re: String to sum
      • From: Martin Orpen <email@hidden>
References: 
 >Re: String to sum (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: Test image properties?
  • Next by Date: This is ridiculous
  • Previous by thread: IS: Re: String to sum -- WAS: Bug in String Coercions containing Operators?
  • Next by thread: Re: String to sum
  • Index(es):
    • Date
    • Thread