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

Re: div bug


  • Subject: Re: div bug
  • From: julifos <email@hidden>
  • Date: Tue, 04 Aug 2009 22:02:46 +0200
  • Thread-topic: div bug

> That binary representation of 1.015 is not exact and is likely to be a little
> (of order 10^-15) smaller than the decimal value..  Add multiply by 100
> (integers are exact until they exceed 10^15 or so) and add 1/2 (which is
> exact) to it and the result will be a tiny bit less than 102.000. Now do an
> integer division of a float by an integer and it will start with discarding
> the fractional part of the float. That is a little bit less than one but the
> whole non-integer part gets tossed. It's truncation, not rounding.

So, when I coerce to small real, AppleScript is rounding (from 8 to 4 bytes)
the number (instead of truncating) and that's because I get the desired
result?

Someone should write the rulez in the ASLG ;--)


jj


 _______________________________________________
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: div bug
      • From: Doug McNutt <email@hidden>
    • Re: div bug
      • From: Philip Aker <email@hidden>
  • Prev by Date: Auto: AppleScript-Users Digest, Vol 6, Issue 354
  • Next by Date: Re: div bug
  • Previous by thread: Re: div bug
  • Next by thread: Re: div bug
  • Index(es):
    • Date
    • Thread