Skip to content

修正了文章中错误的原码、反码和补码,补充了byte & 0xFF中类型提升的细节#180

Closed
ghost wants to merge 1523 commits intomasterfrom
unknown repository
Closed

修正了文章中错误的原码、反码和补码,补充了byte & 0xFF中类型提升的细节#180
ghost wants to merge 1523 commits intomasterfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Nov 11, 2025

新增内容

Java中,byte类型参与运算时会自动提升为int类型,高位通过符号位扩展填充,正数补0,负数补1,byte & 0xFF会先将byte类型提升为int类型,然后将高24位置为0,去掉符号位的影响,仅保留低8位的原始值,从而得到原byte类型值的无符号整数值。

修改内容

文章中举例的值为-118。
原码:00000000 00000000 00000000 10001010 -> 10000000 00000000 00000000 01110110
反码:11111111 11111111 11111111 11110101 -> 11111111 11111111 11111111 10001001
补码:11111111 11111111 11111111 11110110 -> 11111111 11111111 11111111 10001010

删除内容

还原为原码后为
00000000 00000000 00000000 10001010

注:0XFF和-118进行&运算后已经是正数,无需进行还原。

itwanger and others added 28 commits July 18, 2025 11:40
Added information about Java 7 string support and Java 21 switch statement enhancements, including support for long, any object type, and when clauses.
docs: Update Java SE switch statement documentation
Expanded explanations in the Spring MVC and Spring Boot sections, including more details on RESTful interface flow, Spring Boot features, and auto-configuration principles. Added new images and updated memos reflecting recent user feedback and experiences. The readme was updated with an additional testimonial image and related text.
修正了 'Srarter' 拼写为 'Starter',补充并优化了自定义 Spring Boot Starter 的步骤说明,增加了 starter 命名规范、模块划分、自动配置原理和 spring.factories 文件的详细解释。更新了相关图片描述,并添加了最新的学习 memo。
Added new user feedback and updated images in the resume service documentation. Refreshed statistics, offer examples, pricing, and links in the paicoding project documentation to reflect recent milestones and current information.
Expanded explanations of Spring Boot startup principles, annotations, and default scanning paths. Added detailed comparisons between Spring Boot, SpringMVC, and Spring Framework, and enhanced the Spring Cloud and microservices sections with practical examples and architecture diagrams. Improved SpringTask resource optimization strategies and updated memo and feedback images. Also adjusted resume modification pricing and added a price comparison image in the resume documentation.
Enhanced explanations and added illustrative images in Java SE, Java thread, JVM, and MySQL interview documentation. Updated dates and included recent user feedback and success stories to provide more context and motivation for readers.
Added new real-world feedback, offer stories, and technical clarifications to multiple interview guide docs. Enhanced explanations for Java collections, threads, network protocols, Spring features, and design patterns. Included additional code samples, updated question counts, and improved context for interview preparation.
Enhanced sidebar documentation for distributed systems, Java threads, JVM, Redis, and Spring. Added new interview Q&A, technical explanations, diagrams, and real feedback from users. Updated dates and included more practical examples and project references to improve clarity and relevance for upcoming interviews.
Added recent user feedback, clarifications, and examples to multiple sidebar documentation files, including HashMap load factor, ThreadLocal usage, JVM class loading, RocketMQ message ordering, and more. These updates provide additional context, practical advice, and real-world interview experiences to help readers better prepare for technical interviews.
Added detailed examples and explanations for Java反射, 多线程应用场景, 索引创建实践, 以及数据导出功能的设计模式实现。补充了真实用户反馈和成长故事,丰富了文档的实用性和激励性。
Expanded the .gitignore to include additional files and directories for exclusion. Updated paismart.md with new achievements, images, and promotional content, and made minor text corrections to improve clarity.
Revised README and documentation to reflect the increase in community members from 9000+ to 10000, updated upcoming price changes (from 159 to 169/179/189 yuan), and adjusted descriptions of the programming community's offerings. Also updated group numbers and removed outdated references to previous pricing and member counts.
Added deployment instructions and related ignore rules for build artifacts in .gitignore and README.md. Removed redundant docs/.gitignore. Updated theme and sidebar content for clarity and consistency, including date formatting and minor text improvements.
Refined promotional language and improved clarity in README.md and home.md. Updated the VuePress theme notice for more accurate messaging. Major expansion and restructuring of the 'nixi.md' sidebar page, adding new sections, images, testimonials, and detailed information about the 面渣逆袭 PDF 2.0, its structure, and how to access the latest versions.
Added references and sidebar entry for the Go version of the Paismart RAG knowledge base project in README, home, sidebar, and zhishixingqiu readme. Updated documentation to highlight availability and user feedback for the new Go implementation.
修正了文章中错误的原码、反码和补码,补充了byte & 0xFF中类型提升的细节。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.