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

Re: ASTest redux


  • Subject: Re: ASTest redux
  • From: John W Baxter <email@hidden>
  • Date: Fri, 27 Sep 2002 20:09:28 -0700

At 22:46 +0100 9/27/2002, has wrote:
>Oh, and if anyone has any ideas what I might do to compensate for AS's
>stupid treatment of reals, eg:
>
> 0.7 * 0.7 = 0.49
> --> false

The way to avoid that particular aspect of the nature of binary floating
point is not to compare floating point values for equality. Decide how
much of a difference is appropriate to the task at hand to indicate "not
equal", and compare that for greater than the absolute value of the
difference of the two values.

--john

--
John Baxter, Port Ludlow, WA USA
The floating point is the natural enemy of the equals.
The bowling ball is the natural enemy of the egg.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >ASTest redux (From: has <email@hidden>)

  • Prev by Date: Re: String to multiple-item list coercion
  • Next by Date: Re: String to multiple-item list coercion
  • Previous by thread: ASTest redux
  • Next by thread: Re: Dictionary possibilities [Re: Interesting... AppleScript X??]
  • Index(es):
    • Date
    • Thread