haskell - 如何让haskell输出不是科学计数法的数字?

我有一些项目想要划分为多个桶,这样每个桶都比上一个大一些。

items = 500
chunks = 5
increment = 0.20


{- find the proportions  -}
sizes = take chunks (iterate (+increment) 1)    
base = sum sizes / items    
buckets = map (base *) sizes

main = print buckets

我确信有一种数学上更优雅的方法可以做到这一点,但这不是我的问题。 最后一步总是以科学计数法打印出来。

如何获得纯十进制输出?我看过 Numeric包,但我的速度很快。

最佳答案

> putStrLn $ Numeric.showFFloat Nothing 1e40 ""
10000000000000000000000000000000000000000.0

https://stackoverflow.com/questions/8098457/

相关文章:

ruby-on-rails - 在 Ruby 中将换行符解释为 markdown(Github Ma

c - printf 格式(%d 与 %u)

c# - 在单个键盘快捷键中使用 R# 重新格式化代码

formatting - Go 语言中的打印格式列表

r - 用适当的精度数字校正R中的“摘要”

python - 将文本列表格式化为列

r - 自动格式化 R 代码的工具

linux - 如何在 unix/linux 中显示 'ls -l' 命令的列标题?

java - 打印出数组中的元素,元素之间使用逗号

c# - 对混合数字和字符串进行排序