ConsoleTom
Member
Hi !
I want to write a routine for choose values. Example: Values 0-32 in 4 columns. The only problem is, how to find the remainder and use it in if.
When i want to put 0-32 (33 Values since counted from 0) in 4 columns, each column needs 8.025 (it may be wrong, but its an example) lines. So i would like to make 9 lines out of it.
In a short sentence: if remainder of x/y != 0, add 1.
The solution i tried did not work:
nValuesPerCol = (nValues/nCols); /* how many entries per col */
if (nValues%nCols) nValuesPerCol++;
Any idea ? Perhaps datatype-problem ? Or what ?
Greetings
Tobias
I want to write a routine for choose values. Example: Values 0-32 in 4 columns. The only problem is, how to find the remainder and use it in if.
When i want to put 0-32 (33 Values since counted from 0) in 4 columns, each column needs 8.025 (it may be wrong, but its an example) lines. So i would like to make 9 lines out of it.
In a short sentence: if remainder of x/y != 0, add 1.
The solution i tried did not work:
nValuesPerCol = (nValues/nCols); /* how many entries per col */
if (nValues%nCols) nValuesPerCol++;
Any idea ? Perhaps datatype-problem ? Or what ?
Greetings
Tobias