Follow

ちょっとだけ小難しい話 

プリミティブのdoubleを使うという手段もあるんだけど、桁落ちがあるので非推奨。

小数点って簡単なようで面倒で、 0と1の世界だと計算がすぐ狂うので、BigDecimalで精度もあわせてもっておいて、表示する時だけ文字列(textだっけ、C#。)にするというのが定番

Sign in to participate in the conversation
シャドバドン

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!