ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

¦Û¤v¼g ¦Û¤vªº¤è¦¡²£¥Í¶Ã¼Æ

¦^´_ 11# sunnyso


    integer ªº½d³ò¡A¥u¦³¨ì +32767, ¤£¦æ¨Ï¥Î

long ªº½d³ò¡AÁöµM¦³¨ì +2147483647
¦ý¬O¡A¤U¤@­Ó ¶Ã¼Æ¡Aµ¥©ó «e¤@­Ó¶Ã¼Æ¡A­¼¤W a, a= 7^5= 16807
´NÃz±¼¤F

©Ò¥H¡A¥²¶·¨Ï¥Î double,

single ªººë½T«×¡A¥u¦³ 2^24, ¤j¬ù¬O 10^7, ¤£°÷¨Ï¥Î
©Ò¥H¡A¥²¶·¨Ï¥Î double

·íµM¡A¥²¶· ¤ÏÂдú¸Õ ¨C¤@­Ó ²Ó¸`
¤Ñ¤U¬°¤½

TOP

¦^´_ 10# sjgau

thanks in advance
ss

TOP

¦^´_ 9# sunnyso


    OK

µ¥§Ú 11/8 ¤é¥»¦^¨Ó ¦A»¡
¤Ñ¤U¬°¤½

TOP

¦^´_ 8# sjgau

¤£¬O«ÜÀ´, ¥i§_¥Îvba ¼g¤@¬qcode? ÁÂÁÂ
ss

TOP

http://en.wikipedia.org/wiki/Linear_congruential_generator

¤W­±©Ò¤¶²Ðªº¬O ¥Ø«e«Ü¬y¦æªº²£¥Í¶Ã¼Æªº¤èªk¤§¤@
½u©Ê¦P¾l¡C
§Ú²ßºD¨Ï¥Î Apple Lab. ªº«Y¼Æ
R(n)= (R(n-1)*A + B) MOD C

A= 7^5= 16807,
B= 0
C= (2^31) - 1 = 2147483647
¤Ñ¤U¬°¤½

TOP

¦^´_ 6# sjgau


  ¶Ã¼Æ¤£­ã¨Ï¥Î rnd ­n¦p¦ó¨Ï¥Î ? ´Á«Ý
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¤£­ã ¨Ï¥Î rnd
¤Ñ¤U¬°¤½

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2013-10-26 12:23 ½s¿è

¦^´_ 4# sunnyso
VBA Function Example

The RND function can only be used in VBA code in Microsoft Excel.
Here are some examples of what the RND function would return:
  1.     Int ((10 - 1 + 1) * Rnd + 1)     '   ¶Ç¦^¤¶©ó 1 ¨ì 10 ¶¡ªº¶Ã¼Æ­È
  2.     Int ((200 - 100 + 1) * Rnd + 100)   '  ¶Ç¦^¤¶©ó 100 ¨ì 200 ¶¡ªº¶Ã¼Æ­È
  3.     Int ((600 - 300 + 1) * Rnd + 300) '  ¶Ç¦^ ¤¶©ó 300 ¨ì 600 ¶¡ªº¶Ã¼Æ­È
½Æ»s¥N½X
For example:
  1. Sub Demo()
  2.     Dim retNum As Integer

  3.     retNum = Int ((300 - 200 + 1) * Rnd + 200)
  4.     MsgBox "retNum ªº¶Ã¼Æ­È = " & retNum
  5. End Sub
½Æ»s¥N½X
In this example, the variable called retNum would now contain a random number between 200 and 300.

TOP

¦^´_ 3# sjgau

´Á«Ýing + Ãöª`ing
ss

TOP

¦^´_ 2# sunnyso


    ¥ý¸ÑÄÀ¡A¬°¦ó­n ¦Û¤v¼g

¤@ ¦Û¤v¥Íªº¤p«Ä¡A¤~¥i¥H¥´

¤G ±q¼g§@ªº ¹Lµ{¡A¥i¥Hµo²{«Ü¦h°ÝÃD©M ¾Ç°Ý

·q½Ð´Á«Ý
¤Ñ¤U¬°¤½

TOP

        ÀR«ä¦Û¦b : ®É®É¦n¤ß´N¬O®É®É¦n¤é¡C
ªð¦^¦Cªí ¤W¤@¥DÃD