tags:

views:

33

answers:

1

for example i want create following matrix http://en.wikipedia.org/wiki/Hilbert_matrix i have only one question i want that matrix contan element like a/b form and not itself result it means that i want 2/5 and not 0 or 0.4 in case double please help can i make it in integer array?

+2  A: 

If you actually want to preserve the numerator and denominator, you are likely best off using a matrix filled with Pair objects, each containing a pair of ints representing the numerator and denominator, respectively. Implementation details will, of course, depend on the language.

VeeArr
Yes, that or two matrices
Guillaume
In general, I would assert that it is better to use one matrix containing a `Pair`, if possible, as it allows you to create your functions based on `Pair`s (which is applicable in this case, because the data in the `Pair` really represents one value).
VeeArr