• 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: magic integer converter number 62? (John W Baxter)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: magic integer converter number 62? (John W Baxter)


  • Subject: Re: magic integer converter number 62? (John W Baxter)
  • From: Nigel Smith <email@hidden>
  • Date: Thu, 22 Feb 2001 10:39:08 +0000

NG suggested using

num div 1

in response to MShaw's need to recreate(?)

on floor(num)
return (((100 + (num - (num mod 1))) - 100) as integer)
end int


I may be wrong, I'm no programmer, but isn't floor *always* rounding down? ie:
floor(5.5) = 5
floor(-5.5) = -6

In which case

on floor(num)
if num < 0 then
return (num div 1) - 1
else
return num div 1
end if
end floor

...should do the business (though someone is bound to point out a quicker
way!).

Nigel


References: 
 >Re: magic integer converter number 62? (John W Baxter) (From: Nigel Garvey <email@hidden>)

  • Prev by Date: Re: Missing Digests
  • Next by Date: deselecting on the Finder
  • Previous by thread: Re: magic integer converter number 62? (John W Baxter)
  • Next by thread: Re: magic integer converter number 62? (John W Baxter)
  • Index(es):
    • Date
    • Thread