[英]Overflow errors converting Python program to VB .NET
How are you?你好吗?
In order to make the program I am working on more user-friendly and easier to deploy on Windows machines, I am in the process of converting an algorithm from Python (which works wonders) to VB .NET.为了使我正在开发的程序更加用户友好且更易于在 Windows 机器上部署,我正在将算法从 Python(这很有效)转换为 VB .NET。
In this order:
-> Fetching decimal from data sheets (Excel, CSV, XML...)
-> Conversion to binary (string)
-> Binary manipulation / appending
-> Inversion (first char becomes last)
-> Conversion to signed integer for additional math
-> Final conversion to Hexadecimal (targeting a car ECU implementation)
However, this algorithm does huge number conversions (we are talking 1.0E100+), and while everything is done seamlessly in Python thanks to the variables auto assignment, etc., I can't seem to manipulate them on VB .NET due to their size, causing OverflowExceptions all the time.然而,这个算法进行了大量的转换(我们说的是 1.0E100+),虽然由于变量自动分配等,一切都在 Python 中无缝完成,但由于它们的大小,我似乎无法在 VB .NET 上操作它们,一直导致溢出异常。
So far, I know the biggest variables available in VB .NET are Decimal and UInt64, but they definitely don't suit my needs.到目前为止,我知道 VB .NET 中可用的最大变量是 Decimal 和 UInt64,但它们绝对不适合我的需要。
I also know that I can bypass the OverflowException checking in Visual Studio, but what would be the downsides?我也知道我可以绕过 Visual Studio 中的 OverflowException 检查,但是有什么缺点呢? What leads/ideas/solutions would you suggest me?
你会建议我什么线索/想法/解决方案? Is there any way to manipulate these kinds of numbers just like I did in Python?
有没有办法像我在 Python 中那样操作这些类型的数字?
Thank you very much!非常感谢!
A BigInteger
can hold a number as large as how much memory your application can allocate. BigInteger
可以容纳与您的应用程序可以分配多少内存一样大的数字。 Thus the more memory your application is able to allocate, the larger number the structure can hold.因此,您的应用程序能够分配的内存越多,结构可以容纳的内存就越大。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.