JaysGitLab / cs5666-spr17-javatrix-ccubed

cs5666-spr17-javatrix-ccubed created by GitHub Classroom
0 stars 0 forks source link

void print(int w, int d) #47

Open bclinthall opened 7 years ago

campellcl commented 7 years ago
public void print(int w,
                  int d)
Print the matrix to stdout. Line the elements up in columns with a Fortran-like 'Fw.d' style format.
Parameters:
w - Column width.
d - Number of digits after the decimal.
campellcl commented 7 years ago

The most common variable format is the F format for real numbers in decimal form. The syntax for this format is: Fw.d where w is the width of the variable and d is the number of decimal places to the right of the (implied) decimal point. For example, F4.0 would read a four digit number with no implied decimal places.

bclinthall commented 7 years ago

@ccampell I googled Fotran Fw.d, and got this page: http://www.tat.physik.uni-tuebingen.de/~kley/lehre/ftn77/tutorial/format.html Based on that, and the specs, I think the idea is that you should print every cell in the matrix. Each cell should be w characters wide and have d significant digits.