小编JAW*_*025的帖子

如何将double舍入到最接近的整数然后转换为float?

我正在使用java.util.Random生成随机高斯.我需要将此高斯转换为浮点值.然而高斯是一个双,所以我需要一些方法来圆或然后将其转换为浮点数.我需要四舍五入到最近的整数,四舍五入.这是我的问题:如何?

java rounding

29
推荐指数
2
解决办法
11万
查看次数

Intel x86 32 位寄存器混淆

我一直在尝试在我的 Linux 操作系统上学习 32 位 Intel x86 nasm 语法程序集,我遇到了一个关于四个通用 32 位寄存器的问题。

从我一直思考,EAX是,本来要使用的32位寄存器与16位寄存器AX,其中又分为啊(高8位)和人(低8位)。ebx、ecx 和 edx 也是如此。

然而,在阅读了一篇快速文章后,我变得有点困惑。

32 位寄存器是否由 16 位寄存器(依次由两个 8 位寄存器组成)加上额外的 16 位组成?

到目前为止,我在谷歌上读到的所有结果都说明了它们的用途,而不是它们的实际组成。

x86 assembly 32-bit nasm cpu-registers

5
推荐指数
1
解决办法
1077
查看次数

汇编中的源索引

可能重复:
括号在x86 asm中的含义是什么?

我有一段时间对此感到困惑."si"和"[si]"有什么区别?(这是使用16位NASM语法)

assembly nasm 16-bit

2
推荐指数
1
解决办法
1205
查看次数

如何将变量添加到数组中

我试图将数组中的值设置为变量.这是我的代码:

//init the array as a float
//I have tried to put a value in the brackets, but it returns a different error.
//I initialized it this way so I could call it from other methods
private float[] map;

// generate a "seed" for the array between 0 and 255
float x = generator.nextInt(256);
int n = 1;
// insert into the first 25 slots
while(n <= 25) {
    // here's my problem with this next line
    map[n] = x; …
Run Code Online (Sandbox Code Playgroud)

java arrays random variables loops

-2
推荐指数
1
解决办法
3200
查看次数

标签 统计

assembly ×2

java ×2

nasm ×2

16-bit ×1

32-bit ×1

arrays ×1

cpu-registers ×1

loops ×1

random ×1

rounding ×1

variables ×1

x86 ×1