rotateright_Java Long类rotateRight()方法的示例

rotateright

长类rotateRight()方法 (Long class rotateRight() method)

  • rotateRight() method is available in java.lang package.

    rotationRight()方法在java.lang包中可用。

  • rotateRight() method is used to returns the value generated by rotating the binary 2’s complement denotation of the given argument (value) right by the given number of bits.

    rotationRight()方法用于返回通过将给定参数(值)的二进制2的补码符号向右旋转给定位数而生成的值。

  • rotateRight() method is a static method, it is accessible with the class name too and if we try to access the method with the class object then also we will not get an error.

    rotationRight()方法是一个静态方法,也可以使用类名进行访问,如果尝试使用类对象访问该方法,那么也不会收到错误。

  • rotateRight() method does not throw an exception at the time of rotating or shifting of bits.

    旋转或移位位时, rotateRight()方法不会引发异常。

Syntax:

句法:

    public static long rotateRight (long value, int rotation);

Parameter(s):

参数:

  • long value – represents the long value to be parsed.

    long value –表示要解析的long值。

  • int rotation – represents the distance of rotation.

    int rotation –表示旋转距离。

Return value:

返回值:

The return type of this method is long, it returns a long value generated by rotating the 2’s complement binary of the given long value right by the given number of bits.

此方法的返回类型为long ,它返回通过将给定long值的2的补码二进制数右移给定位数而生成的long值。

Example:

例:

// Java program to demonstrate the example 
// of rotateRight (long value, int rotation) method of Long class
public class RotateRightOfLongClass {
public static void main(String[] args) {
long value = 3;
int rotation = 1;
// Iterates till the value of rotation reaches
while (rotation < 4) {
// It return the value generated by rotating the 2's
// complement of the given argument (value) right 
// by the given number of bits
value = Long.rotateRight(value, 3);
System.out.println("value: " + value);
++rotation;
}
}
}

Output

输出量

value: 6917529027641081856
value: 864691128455135232
value: 108086391056891904

翻译自: https://www.includehelp.com/java/long-class-rotateright-method-with-example.aspx

rotateright

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/379142.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

实验四 Windows程序设计

1&#xff0c;创建Windows窗体应用程序&#xff0c;实现用户登录功能&#xff0c;当输入正确与错误时均给出相应的提示信息&#xff0c;规定用户输入错误次数不能超过3次。&#xff08;源代码运行界面&#xff09; 这里的口令有个小常识&#xff0c;就是显示*&#xff0c;在口令…

最小连通-(代码、分析、汇编)

目录&#xff1a;介绍&#xff1a;代码&#xff1a;分析&#xff1a;汇编&#xff1a;介绍&#xff1a; 一个有 n 个结点的连通图的生成树是原图的极小连通子图&#xff0c;且包含原图中的所有 n 个结点&#xff0c; 并且有保持图连通的最少的边。 最小生成树可以用kruskal&am…

toad dba for oracle 10.5

http://worlddownloads.quest.com.edgesuite.net/Repository/support.quest.com/Toad%20for%20Oracle/10.5/Software/Toad%20DBA%20Suite%20for%20Oracle%2010.5%20Commercial.exe转载于:https://www.cnblogs.com/devbar/archive/2010/07/01/1768986.html

c++ 怎样连接两个链表_LeetCode | 链表的入口,一文帮你搞定“环形链表”(python版,最简单解析)...

链表节点的定义链表作为一种数据结构&#xff0c;由链表节点互相连接构成。链表节点包含自身的数据和一个指向下一节点的指针。""" Definition of ListNode """ class ListNode(object):def __init__(self, val, nextNone):self.val valself.ne…

QI实例-改变空间参考

学习AE一段时间了&#xff0c;总是对QI不是很理解&#xff0c;今天一晚上写了QI实例&#xff0c;尝试理解下。 首先想到的是→改变空间参考→alter、SpatialReference→alterSpatialReference&#xff0c;输入到帮助文档里。  查看是IGeoDatasetSchemaEdit接口的方法&#xf…

VeryCD 的资料库

呵呵&#xff0c;刚才看了下VeryCD的资料库&#xff0c;恍然间才明白为什么VeryCD以前花大量时间和精力开发电驴&#xff0c;又为什么不久前突然取消了KAD网络和ED2k网络的搜索功能。呵呵&#xff0c;天下没有免费的午餐哈&#xff0c;VeryCD先用电驴软件聚集客户群&#xff08…

Java IdentityHashMap keySet()方法及示例

IdentityHashMap类keySet()方法 (IdentityHashMap Class keySet() method) keySet() method is available in java.util package. keySet()方法在java.util包中可用。 keySet() method is used to get a set of all the existing keys in this IdenityHashMap to be viewed in …

C#省市二级联动(王者荣耀挑选英雄为例)

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;namespace beyond_联动_ {public partial clas…

二叉排序树(Binary Sort Tree) 又称为二叉查找树(Binary Search Tree) - (代码、分析)

目录&#xff1a;代码&#xff1a;分析&#xff1a;代码&#xff1a; BSTree.h #ifndef _BSTREE_H_ #define _BSTREE_H_typedef void BSTree;//定义二叉树类型 typedef void BSKey;//定义节点的键值类型&#xff08;用于节点排序&#xff09;typedef struct _tag_BSTreeNode …

springboot tomcat默认线程数_记一次JAVA线程池的错误用法

最近项目一个项目要结项了&#xff0c;但客户要求 TPS 能达到上千&#xff0c;而用我写的代码再怎么弄成只能达到 30 的 TPS&#xff0c;然后我又将代码中能缓存的都缓存了&#xff0c;能拆分的也都拆分了&#xff0c;拆分时用的线程池来实现的&#xff1b;其实现的代码主要为…

引以为鉴-ARM开发板连线注意事项

前些日子把实验室的三台机子放到一个工位上&#xff0c;非常拥挤&#xff0c;做实验也很不方便。因此&#xff0c;想把ARM开发板的环境重新搭建到自己的电脑上。说完就做&#xff0c;上午就开始忙活起来。把开发板上的USB线、串口线、JTAT接口、还有电源线一一插好。接着就开始…

CString 类型和引用

怎么理解CString & 类型&#xff1f;在函数参数表中&#xff0c;列了一项是此类型&#xff0c;据说是引用。可以给个具体方法&#xff0c;示例么&#xff1f; 由于子程序调用是栈传递参数&#xff0c;因此对参数的修改不会改变调用者传入的参数的值。如果要改变调用者的参数…

Java IdentityHashMap putAll()方法与示例

IdentityHashMap类putAll()方法 (IdentityHashMap Class putAll() method) putAll() method is available in java.util package. putAll()方法在java.util包中可用。 putAll() method is used to copy all of the entry (key-value pairs) that exists from the given map (m)…

Python---实验八

1&#xff0c;现在有一份‘邀请函.txt’的空白文件&#xff0c;请在同级目录下编写一段代码&#xff0c;写入内容‘诚挚邀请您来参加本次宴会’。 with open(fG:\study\Python\邀请函.txt,modew,encodingutf-8) as y:y.write(诚挚邀请您来参加本次宴会)效果图如下&#xff1a;…

哈希表 - (代码、分析 )

目录&#xff1a;代码&#xff1a;分析&#xff1a;代码&#xff1a; BSTree.h BSTree.c 二叉排序树(Binary Sort Tree) 又称为二叉查找树(Binary Search Tree) Hash.h #ifndef _HASH_H_ #define _HASH_H_typedef void Hash;//定义哈希表类型 typedef void HashKey;//定义哈…

scala spark 数据对比_IT大牛耗时三个月总结出大数据领域学习路线,网友评论:炸锅了...

大数据不是某个专业或一门编程语言&#xff0c;实际上它是一系列技术的组合运用。有人通过下方的等式给出了大数据的定义。大数据 编程技巧 数据结构和算法 分析能力 数据库技能 数学 机器学习 NLP OS 密码学 并行编程虽然这个等式看起来很长&#xff0c;需要学习的东…

Java IdentityHashMap equals()方法与示例

IdentityHashMap类equals()方法 (IdentityHashMap Class equals() method) equals() method is available in java.util package. equals()方法在java.util包中可用。 equals() method is used to check whether this IdentityHashMap object and the given object (ob) are eq…

jQuery中关于Ajax的详解

本文介绍如何使用jquery实现Ajax功能. 用于发送Ajax请求的相关函数如load, get, getJSON和post这些渐变Ajax方法, 对于核心的ajax 方法没有过多介绍, 主要是通过配置复杂的参数实现完全控制Ajax请求。 Ajax让用户页面丰富起来, 增强用户体验. Ajax是所有Web开发的必修课. 虽然A…

Python---实验九作业

1&#xff0c;使用tkinter实现计算器程序。实现效果如下&#xff1a; from tkinter import * from tkinter.ttk import *def frame(master):"""将共同的属性作为默认值, 以简化Frame创建过程"""w Frame(master)w.pack(sideTOP, expandYES, fill…

分析FLV文件分析和解析器的开源代码

分析一下GitHub上一份FLV文件分析和解析器的开源代码 GitHub源码地址&#xff1a;功能强大的 FLV 文件分析和解析器 &#xff1a;可以将flv文件的视频tag中的h264类型数据和音频tag中的aac类型数据导出 &#xff08;只限h264和aac&#xff09; (这个代码不太适合用于大文件的分…