gonum / matrix

Matrix packages for the Go language [DEPRECATED]
446 stars 53 forks source link

Update format documentation to include additional format verbs #421

Closed DavidGamba closed 7 years ago

DavidGamba commented 7 years ago

The format documentation only shows examples of using the %v verb for format. It took me looking at issue #189 to figure that you could use %3.3g to limit the width of each field. I tried forking to update the following test: https://github.com/gonum/matrix/blob/20e0dce1afa810a68a601b427ec7b91ac31234f2/mat64/format_example_test.go#L21

But there is no simple makefile to install all of the repo's dependencies so my test fails.

Anyway, maybe adding something like:

fmt.Printf("for large exponents:\na = %3.3g\n\n", fa)

To the example would help and indicating that you support all verbs in https://golang.org/pkg/fmt/ .

Thanks!

btracey commented 7 years ago

It's a good idea to add such an example

But there is no simple makefile to install all of the repo's dependencies so my test fails.

Did you try go get -u -t?

DavidGamba commented 7 years ago

This is what I get:

go get -u -t
package github.com/davidgamba/matrix/mat64
        imports github.com/gonum/internal/asm: use of internal package not allowed
go test
package github.com/davidgamba/matrix/mat64
        imports github.com/gonum/internal/asm: use of internal package not allowed
btracey commented 7 years ago

Because of internal packages, you need to have your fork be in a gonum-like path on your filesystem.

This seems to have a good description: http://stackoverflow.com/questions/14323872/using-forked-package-import-in-go