c# - BigInteger 在 Swift 中的实现
问题描述
以下实现是在 C# 中完成的,我正在尝试转换为 Swift。
但是,我想知道如何BigInteger
在 Swift 中使用,我以前没有见过这种数据类型。如果有人分享任何想法在 Swift 中创建类似的东西,我真的很感激。
custom.test_u128(BigInteger.One);
CollectionAssert.AreEqual(custom.get_bytes(), new byte[] { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 });
protected readonly MemoryStream buffer;
public byte[] get_bytes() => buffer.ToArray();
解决方案
推荐阅读
- css - 编译的 css 因带有 & 符号的嵌套 mixin 而失败
- python - 如何从 python 谷歌云函数访问文件元数据,用于谷歌云存储中的文件
- python-3.x - 如何在python中的另外3个引号字符串中嵌套一个条件3个引号字符串?
- python - 从 3 个变量循环所有可能的组合
- laravel - Laravel Blade 双花括号不起作用
- z3 - 有没有办法将输入作为正常表达式提供给 Z3 Solver?
- .net-core-2.2 - 有没有办法根据使用的 http 动词有条件地验证模型?
- sed - sed输出变成sed输入?
- ios - Adaptive Cards iOS - 如何在卡片边缘添加填充?
- ios - queryStarting(atValue 没有按预期工作?