浮点精度损失大的问题

While running:

package main

import (
    "fmt"
    "math/big"
)

func main() {
    a := big.NewFloat(float64(2.1234))
    fmt.Println(a.Text(102,18))
}

I expected 2.123400000000000000 as output, but instead got 2.123400000000000176.

Can someone explain me why I do not have the expected number?

big.NewFloat(float64(2.1234))

float64(2.1234) converts to Go float64 (IEEE-754 64-bit floating-point), which has 53 bits of precision.

For example,

package main

import (
    "fmt"
    "math/big"
)

func main() {
    // 53 bits of precision (float64)
    a := big.NewFloat(float64(2.1234))
    fmt.Println(a.Text(102, 18))

    x := "2.1234"

    // 53 bits of precision
    f, _, err := big.ParseFloat(x, 10, 53, big.ToNearestEven)
    if err != nil {
        panic(err)
    }
    fmt.Println(f.Text(102, 18))

    // 256 bits of precision
    f, _, err = big.ParseFloat(x, 10, 256, big.ToNearestEven)
    if err != nil {
        panic(err)
    }
    fmt.Println(f.Text(102, 18))
}

Playground: https://play.golang.org/p/z5iK90lQcD9

Output:

2.123400000000000176
2.123400000000000176
2.123400000000000000