【问题标题】:How can I use scientific notation in Erlang?如何在 Erlang 中使用科学记数法?
【发布时间】:2022-01-05 23:39:05
【问题描述】:

这是我尝试在 Erlang 中简洁地写出 100 万这个数字的方法:

$ erl
1> 1e6.
* 3: syntax error before: e6

有没有现成的方法来做,比

1> math:pow(10,6).
1.0e6

?

【问题讨论】:

    标签: erlang


    【解决方案1】:

    math:pow 的输出正盯着我看:

    Eshell V12.1.2  (abort with ^G)
    1> 2.3e-3.
    0.0023
    

    【讨论】:

      猜你喜欢
      • 2018-11-17
      • 2013-04-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-09
      • 2019-10-24
      • 2018-09-13
      • 2021-01-27
      相关资源
      最近更新 更多