• 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: Date math problem in Leopard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Date math problem in Leopard


  • Subject: Re: Date math problem in Leopard
  • From: KOENIG Yvan <email@hidden>
  • Date: Sat, 15 Mar 2008 18:16:54 +0100


Hello, I tried

--
set newIssue to 1056
set firstIssue to date "jeudi 24 décembre 1987 12:00:0"
set limite to 887 (* OK with 887, wrong with 888 *)
repeat while newIssue > limite
	set firstIssue to firstIssue + (limite * weeks)
	set newIssue to newIssue - limite
end repeat
set newDate to firstIssue + (newIssue * weeks)
--
log newIssue -- value is 1056 to be published Mar. 20, 2008
log (newDate as text)

log limite * weeks -- (*5.364576E+8*)
log (2 ^ 30) / 2 -- (*5.36870912E+8*)
log (limite + 1) * weeks -- (*5.370624E+8*)
log (2 ^ 30) / (limite * weeks) -- (*2.001540893446*)
log (2 ^ 30) / ((limite + 1) * weeks) -- (*1.999286905954*)

it appears that the bug is not starting at 2^30
but around  .5 * (2^30),
and that with a slightly modified script, we may live with the bug ;-)

Yvan KOENIG _______________________________________________
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: 
 >Date math problem in Leopard (From: Jeff Jungblut <email@hidden>)
 >Re: Date math problem in Leopard (From: "Mark J. Reed" <email@hidden>)
 >Re: Date math problem in Leopard (From: Christopher Nebel <email@hidden>)
 >Re: Date math problem in Leopard (From: KOENIG Yvan <email@hidden>)

  • Prev by Date: Re: File best practice questions
  • Next by Date: Re: Date math problem in Leopard
  • Previous by thread: Re: Date math problem in Leopard
  • Next by thread: Re: Date math problem in Leopard
  • Index(es):
    • Date
    • Thread