非常非常大的C#浮点数 [英] Very, very large C# floating-point numbers

查看:145
本文介绍了非常非常大的C#浮点数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一些人口模型(为了好玩,主要是为了与承载力的概念和物流功能发挥)。该模型可用于多个行星(其中约10万件,现在)。当人口达到上一个星球承载能力,居民开始分支到附近的行星,等等

I am doing some population modeling (for fun, mostly to play with the concepts of Carrying Capacity and the Logistics Function). The model works with multiple planets (about 100,000 of them, right now). When the population reaches carrying capacity on one planet, the inhabitants start branching out to nearby planets, and so on.

问题:100,000行星可容纳的人不少。比C#小数更多可以处理。因为我在做均线和其他的东西有这些数字,我需要浮动点(或我只是使用BIGINT库)工作的能力。

Problem: 100,000+ planets can house a LOT of people. More than a C# Decimal can handle. Since I'm doing averages and other stuff with these numbers, I need the capability to work with floating points (or I'd just use a BigInt library).

请问任何人都知道一个BigFloatingPoint类(或其他)我可以使用吗?谷歌今天是非常无益的。我大概可以写一个类,将工作做得不够好,但我宁愿用一些预先存在的,如果这样的事情存在。

Does anyone know of a BigFloatingPoint class (or whatever) I can use? Google is being very unhelpful today. I could probably write a class that would work well enough, but I'd rather use something pre-existing, if such a thing exists.

推荐答案

使用megapeople单位达成更多的空间。

Use units of megapeople to achieve more headroom.

此外,小数让你有每个100000行星与人口百兆时代的地球,如果的我的算术是正确的。你确定这还不够?

Also, Decimal lets you have 100,000 planets each with 100000000000000 times the population of the Earth, if my arithmetic is right. Are you sure that's not enough?

这篇关于非常非常大的C#浮点数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆