Long.reverse(long ) 方法有什么用?

发布于 2024-08-14 17:14:19 字数 102 浏览 1 评论 0原文

我在Long类中找到了一个方法

public static long reverse(long i) {..}

这个方法有什么用呢?

I found one method in Long class

public static long reverse(long i) {..}

What is the use of this method?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

深爱成瘾 2024-08-21 17:14:19

来自 DDJ 文章

为什么要颠倒顺序
32 位或 64 位值中的位?少量
反转可用于多种用途
上下文。在图像中很有用
翻转处理
黑白图像来创建
镜像。翻转图像
水平方向上,一行中的像素
图像必须反向放置
命令。快速64位位反转可
在反转行的过程中使用
的黑白像素。相似地,
64 位位反转很有用
将黑白图像旋转 180 度
度。

From an DDJ article:

Why would you reverse the order of
bits in a 32-bit or 64-bit value? Bit
reversal can be useful in a variety of
contexts. It's useful in image
processing for flipping a
black-and-white image to create a
mirror image. To flip an image
horizontally, the pixels in a row of
the image must be placed in reverse
order. Fast 64-bit bit reversal can be
used in the process of reversing a row
of black-and-white pixels. Similarly,
64-bit bit reversal is useful for
rotating a black and white image 180
degrees.

只等公子 2024-08-21 17:14:19

显然,位反转用于数字信号处理应用,如快速傅里叶变换。我不会假装理解为什么它有效,但也许链接到的页面对您来说会很清楚。

Apparently bit reversal is used in digital signal processing applications, as in the Fast Fourier Transform. I won't pretend to understand why it works, but perhaps the linked-to page will be clear to you.

眼眸 2024-08-21 17:14:19

您可以使用位反转来更轻松地进行屏蔽操作。

You can use bit reversal to make it easier to work with masking operations.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文