美文网首页
0.1+0.2在不同语言中的表现

0.1+0.2在不同语言中的表现

作者: vanhukset | 来源:发表于2019-07-22 20:12 被阅读0次

    0.1+0.2在不同语言中的表现

    python

    print(0.1+0.2);// output 0.30000000000000004
    

    js

    0.2+0.1;//output  0.30000000000000004
    

    golang

    package main
    
    import (
        "fmt"
      
    )
    
    func main() {
       fmt.Println(0.1+0.2)//output 0.3
    }
    

    JAVA

    public static void main(String[] args) {
        System.out.println(0.1+0.2);  //output  0.30000000000000004
      }
    

    PHP

    echo 0.1+0.2;//output 0.3
    

    相关文章

      网友评论

          本文标题:0.1+0.2在不同语言中的表现

          本文链接:https://www.haomeiwen.com/subject/kkdglctx.html