From: Ioannis Mitsos on 12 Feb 2010 13:30 Hello, I have two variables i and j and they are always positive. j is equal to the result of the division of any positive number with i. Example: i=15, for a random number 42 j=42/i =2.8 however I want j to be equal to 2. So, for every division of i with a random positive number, I want j to take the value of the first digit. Eg. i=15 so for a number=3 the division is j=3/i=0 and not 0.2 as the result is.
From: dpb on 12 Feb 2010 13:34 Ioannis Mitsos wrote: > Hello, > > I have two variables i and j and they are always positive. j is equal > to the result of the division of any positive number with i. > > Example: i=15, for a random number 42 j=42/i =2.8 however I want j to > be equal to 2. > So, for every division of i with a random positive number, I want j to > take the value of the first digit. > > Eg. i=15 so for a number=3 the division is j=3/i=0 and not 0.2 as the > result is. ML stores as default doubles not integers. You can either use floor() or coerce to integers if that's more suitable. --
|
Pages: 1 Prev: wavelet packet decomposition.. Next: Input a few vectors in order to generate a "Vector Field" |