Browse Source

Formatting

pull/768/head
xpetit 3 years ago
parent
commit
a30aabf297
No known key found for this signature in database
GPG Key ID: 97C60669182C17A5
  1. 2
      go/tests/func/activebits_test/main.go
  2. 6
      go/tests/func/convertbase_test/main.go

2
go/tests/func/activebits_test/main.go

@ -8,7 +8,7 @@ import (
// Function that return the number of active bits in the number passed as the argument
func activeBits(n int) (total int) {
for ; n > 1; n = n / 2 {
for ; n > 1; n /= 2 {
total += n % 2
}
total += n

6
go/tests/func/convertbase_test/main.go

@ -13,7 +13,7 @@ func convertNbrBase(n int, base string) string {
for n >= length {
result = string(base[(n%length)]) + result
n = n / length
n /= length
}
result = string(base[n]) + result
@ -51,8 +51,8 @@ func main() {
table = append(table, node{
nbr: "101011",
baseFrom: "01",
baseTo: "0123456789"},
)
baseTo: "0123456789",
})
for _, arg := range table {
lib.Challenge("ConvertBase", student.ConvertBase, convertBase, arg.nbr, arg.baseFrom, arg.baseTo)

Loading…
Cancel
Save