问题标签 [int32]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ios - Playground(Swift)执行被中断问题
同一段代码不能在操场上运行,但可以在 xcode 项目中运行。
出现错误“执行被中断。原因:EXC_BAD_INSTRUCTION....”
这是详细快照
这里的问题是弄清楚为什么会发生这个问题?为什么存在于游乐场而不存在于 xcode 中?
谢谢
assembly - 在汇编中读取和打印 32 位整数
你好!我有一个问题,我希望有人可以帮助我:) 我需要 2 个宏:一个用于读取,另一个用于打印 32 位整数 我有一个周一的项目,但我没有想法 :( 这就是我到现在为止:
parsing - Int32.Parse C# 错误
我正在使用 Unity C#。我得到这个错误“'int.Parse(string, System.IFormatProvider)' 的最佳重载方法匹配有一些无效参数。” 我不明白我做错了什么。
c# - 是否可以使用 Convert.ToInt32(double) 并使其选择最小值?
是否可以使用 Convert.ToInt32(double) 并使其选择最小值?
我已经阅读了 msdn 中的示例,它使用最接近的值将 double 转换为 int,这意味着如果我的 double 等于 2.9,它会将 int 设置为 3。
是否可以使用 convert.toint32 并使用 2?
c# - 中值维护算法 - 相同的实现会根据 Int32 或 Int64 产生不同的结果
我在做一个硬件问题时发现了一些有趣的东西。
howework 问题要求对中值维护算法进行编码。
正式声明如下:
这个问题的目标是实现“中值维护”算法(在第 5 周的堆应用讲座中介绍)。文本文件包含从 1 到 10000 的整数列表,未排序;您应该将其视为一串数字,一个接一个到达。令x i表示文件的第 i个数字,第 k个中值 m k定义为数字 x 1 ,…,x k的中值。(所以,如果 k 是奇数,那么 m k是 x 1 ,…,x k中第((k+1)/2)个最小的数;如果 k 是偶数,则 m 1是第 (k/2)个最小的数x之间的数字1 ,…,x k .)
为了获得O(n)的运行时间,这显然应该使用堆来实现。无论如何,我使用蛮力进行了编码(截止日期太早,需要立即得到答案)(O(n 2 )),步骤如下:
- 读入数据
- 排序数组
- 查找中位数
- 将其添加到运行时间
我通过几个测试用例(具有已知答案)运行该算法并得到正确的结果,但是当我在更大的数据集上运行相同的算法时,我得到了错误的答案。我正在使用 Int64 ro 进行所有操作来表示数据。然后我尝试切换到 Int32,神奇地我得到了正确的答案,这对我来说毫无意义。
代码在下面,也可以在这里找到(数据在 repo 中)。该算法在 3810 索引后开始给出错误结果:
更有趣的是,运行总和(在 sum64 变量中)产生的结果与使用 LINQ 的 Sum() 函数对列表中的所有项目求和产生的结果不同。
结果(第三个是错误的):
这些是计算机详细信息:
如果有人能给我一些关于为什么会发生这种情况的见解,我将不胜感激。
谢谢,
arm - 霓虹灯铸造问题
我是 NEON 内在函数(A9 处理器)的新手。
我想转换uint8x16_t
为int32x4_t
value 。我尝试使用vreinterpret_s32_u8
to 这样做,但没有奏效。
谁能指导我?非常感谢您的帮助。
c# - LINQ to Entities does not recognize the method 'Int32 Parse(System.String)' method,
I am using Entity Framework, and I have a line of code that convert string field (id)to int and compare with a number
Whenever I try to run it I receive rhis error. "LINQ to Entities does not recognize the method 'Int32 Parse(System.String)' method, and this method cannot be translated into a store expression."
I have tried seveal different things and nothing is working, so any help would be great.
c# - Reorder digits in integer using C#
I want to ask how I can reorder the digits in an Int32
so they result in the biggest possible number.
Here is an example which visualizes what I am trying to do:
I want to perform the ordering of the digits without using the System.Linq
namespace and without converting the integer into a string value.
This is what I got so far:
This algorithm works flawlessly but I think it is not very efficient. I would like to know if there is a way to do the same thing more efficiently and how I could improve my algorithm.
ios - Swift SQLite SQL 计数
在使用 SQLite 的 Swift iOS 8 项目中,我试图使用 SQLCOUNT
函数获取表中的行数。从我在 C 中找到的示例中,我得到了以下代码:
在收到类型不匹配错误后,我将 nRows 的定义更改为 Int32,但我不断收到编译错误(这次是“可选类型 'Int32 的值?未解包。”
有什么线索吗?
c# - 为什么`Int32`在其源代码中使用`int`?
为什么在其源代码Int32
中使用?在 C# 中不等于?那么原始源代码是干什么用的呢?我很困惑..int
Int32
int
int
Boolean
和之间也有同样的问题bool
。