• 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: Random()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Random()


  • Subject: Re: Random()
  • From: Shaun Wexler <email@hidden>
  • Date: Sat, 13 Dec 2003 13:13:07 -0800

On Dec 13, 2003, at 12:41 PM, Joost Markerink wrote:

// how can i get a random float between 0 - 1, do i have to use C? how?

static const float rand_norm = 1.0f / (float)RAND_MAX;

#define RANDOM_FLOAT (rand_norm * (float)rand())

--
Shaun Wexler
MacFOH
http://www.macfoh.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Random()
      • From: Andres Santiago Perez-Bergquist <email@hidden>
References: 
 >Random() (From: Joost Markerink <email@hidden>)

  • Prev by Date: Random()
  • Next by Date: Re: NSMenu Trouble
  • Previous by thread: Random()
  • Next by thread: Re: Random()
  • Index(es):
    • Date
    • Thread