Golang multiplication question.

Asked 2 years ago, Updated 2 years ago, 32 views

Hello, I have a question while solving the question, so I'm posting a question like this.

package main

import "fmt"

func main() {
    var m float32 = 19
    var h float32 = 9
    const grvt float32 = 9.8

    fmt.Printf("%f\n", m*h*grvt)
    fmt.Printf("%f\n", grvt*m*h)
}

Results respectively

1675.800049

1675.799927

I don't understand why it's different when it comes out like this.

go

2022-09-20 19:21

1 Answers

https://dojang.io/mod/page/view.php?id=738


2022-09-20 19:21

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.