Untitled
Anonymous
plain_text
04/30/2023 12:39 AM
336 B
23
Indexable
package main
import (
"fmt"
"math"
)
func main() {
a := float64(6.3)
b := float64(1.0)
quotient := math.Floor(a / b)
remainder := a - quotient*b
fmt.Printf("The remainder is %v", remainder) // return 0.299999 instead of 0.3
}
Editor is loading...