Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. ReneGoos

    How to code For...Each statement

    About the Mod 7. I've checked your question and saw what I feel is a bug in VB. The Mod 7 should map to a value between 0 and 6 always, ..,-7,0,7,14,21,.. Mod 7 = 0; ..,-6,1,8,15,22,.. Mod 7 = 1; ...; ..-1,6,13,20,27,.. Mod 7 = 6. However VB calculates -1 Mod 7 =-1!! This is clearly going...
  2. ReneGoos

    weighted random numbers.....woah!

    You should select just one function and use this for your random values. For a good idea of what the derivative does you should make a graph of the function, for instance x^3. Following the graph you see that near 0, the graph is hardly going up. Therefore points near 0 map to points nearer...
  3. ReneGoos

    weighted random numbers.....woah!

    The logic of the math is in the derivitive. The derivitive should be nearer zero where you want the emphasis and away from zero where you do not want it. A function with a derivitive higher than or equal zero is easiest to map, so this why I use x^3. You could also use x^5 or higher, a log or an...
  4. ReneGoos

    How to code For...Each statement

    Do you mean something like this? Dim datFirst As Date, datLast As Date Dim intFirstDay As Integer, intMyDay As Integer intMyDay = vbWednesday datFirst = CDate("1-1-2002") 'keep it less then the first of the next year datLast = CDate("1-1-2003") 'difference between...
  5. ReneGoos

    weighted random numbers.....woah!

    There are quite a number of ways to get some numbers more often than others. 1. As a mathematician I would use some function to remap the values to increase the chances. You could use a random function to generate a number between 0 and 1 and use some function to map into 0 to 1 again, but with...

Part and Inventory Search

Back
Top