Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/319.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
这个JavaScript代码在c#中的等价物是什么?_C#_Javascript - Fatal编程技术网

这个JavaScript代码在c#中的等价物是什么?

这个JavaScript代码在c#中的等价物是什么?,c#,javascript,C#,Javascript,我有一个JavaScript文件,需要用C#编写。我做了很多,但还是坚持下去。 有人能帮我吗 var biginteger=new bigint(convert); var mod = bigint_mod(biginteger, new bigint(97)); var y = bigint_number(mod); 我无法解释这些JavaScript函数 using System.Numerics; BigInteger dividend= new BigI

我有一个JavaScript文件,需要用C#编写。我做了很多,但还是坚持下去。 有人能帮我吗

var biginteger=new bigint(convert);
var mod = bigint_mod(biginteger, new bigint(97));
        var y = bigint_number(mod);
我无法解释这些JavaScript函数

using System.Numerics;       

BigInteger dividend= new BigInteger(1222222);
BigInteger mod;
BigInteger.DivRem(dividend, new BigInteger(97), out mod);
//mod will have the result


首先,您需要对程序集
System.Numerics.dll
的引用,该程序集是自2010年以来(.NET 4.0及更高版本)的一部分

用户可以使用以下内容:

using System.Numerics

...

      var bigInteger = (BigInteger)convert;  // or BigInteger.Parse(convert); not sure what type convert is
      var y = bigInteger % 97;
当然,
biginger
构造了
%
运算符。文本
97
将隐式转换为
BigInteger


如果不需要新变量,也可以说:
biginger%=97

搜索btw只花了不到一分钟的时间。我能理解,这不值得质疑,但如果有人能帮我解释,那对编写c3类非常有用,请在链接上阅读信息,ffs!!没有人会为你创建一个C#类!我会投反对票,但可惜我没票了。。。
using System.Numerics

...

      var bigInteger = (BigInteger)convert;  // or BigInteger.Parse(convert); not sure what type convert is
      var y = bigInteger % 97;