master
bradley 2 years ago
parent f872820874
commit 4238e749ff

2
.idea/.gitignore vendored

@ -0,0 +1,2 @@
# Default ignored files
/workspace.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/wc_algorithm.iml" filepath="$PROJECT_DIR$/wc_algorithm.iml" />
</modules>
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

@ -0,0 +1,23 @@
package com.bradley.bit;
public class Bit {
public static void printBit(){
int n = 1;
System.out.println(1<<32);
System.out.println(1<<31);
System.out.println(1<<30);
System.out.println(1<<29);
// 1 用二进制表示 32bit ==> 00000000 00000000 00000000 00000001 1*2^0 = 1
// 1 左移32位 ==> 10000000 00000000 00000000 000000000 0*2^0 = 0
// 1 左移31位 ==> 01000000 00000000 00000000 00000000 1*2^31 = 2147483648 4294967296 超出int范围2147483647 变成了 -2147483648
// 1 左移30位 ==> 00100000 00000000 00000000 00000000 1*2^30 = 1
// 1 左移29位 ==> 00010000 00000000 00000000 00000000 1*2^29 = 1
}
public static void main(String[] args) {
// System.out.println(Integer.MAX_VALUE);
printBit();
}
}

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
Loading…
Cancel
Save