René's URL Explorer Experiment


Title: 整型数数据在内存中的存储 · Issue #133 · codcodog/Blog · GitHub

Open Graph Title: 整型数数据在内存中的存储 · Issue #133 · codcodog/Blog

X Title: 整型数数据在内存中的存储 · Issue #133 · codcodog/Blog

Description: 整型数数据在内存中的存储 基本概念 「机器数」指一个数在计算机中的二进制表示形式. 「机器数」是带符号的,在计算机用一个数的最高位存放符号,正数为0,负数为1. 将带符号位的机器数对应的真正数值称为机器数的「真值」. 例如:0000 0001 的「真值」=> +000 0001 = +1,1000 0001 的「真值」=> -000 0001 = –1 「原码」:将十进制数直接翻译为二进制数. 「反码」:原码的符号位不变,其他位按位取反. 「补码」:反码+1. 对于正数...

Open Graph Description: 整型数数据在内存中的存储 基本概念 「机器数」指一个数在计算机中的二进制表示形式. 「机器数」是带符号的,在计算机用一个数的最高位存放符号,正数为0,负数为1. 将带符号位的机器数对应的真正数值称为机器数的「真值」. 例如:0000 0001 的「真值」=> +000 0001 = +1,1000 0001 的「真值」=> -000 0001 = –1 「原码」:将十进制数直接翻译为二进制数...

X Description: 整型数数据在内存中的存储 基本概念 「机器数」指一个数在计算机中的二进制表示形式. 「机器数」是带符号的,在计算机用一个数的最高位存放符号,正数为0,负数为1. 将带符号位的机器数对应的真正数值称为机器数的「真值」. 例如:0000 0001 的「真值」=> +000 0001 = +1,1000 0001 的「真值」=> -000 0001 = –1 「原码」:将十进制数直接翻...

Opengraph URL: https://github.com/codcodog/Blog/issues/133

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"整型数数据在内存中的存储","articleBody":"整型数数据在内存中的存储\r\n=========================\r\n\r\n### 基本概念\r\n\r\n「机器数」指一个数在计算机中的二进制表示形式.\r\n\r\n「机器数」是带符号的,在计算机用一个数的最高位存放符号,正数为0,负数为1.\r\n\r\n将带符号位的机器数对应的真正数值称为机器数的「真值」.\r\n\u003e 例如:0000 0001 的「真值」=\u003e +000 0001 = +1,1000 0001 的「真值」=\u003e -000 0001 = –1\r\n\r\n「原码」:将十进制数直接翻译为二进制数.  \r\n「反码」:原码的符号位不变,其他位按位取反.  \r\n「补码」:反码+1.\r\n\r\n对于正数来说,反码补码都与原码相同.  \r\n而对于负数来说,则符合上述所说的规则:\r\n- 原码,将十进制数字直接翻译为二进制\r\n- 反码,原码的符号位不变,其他位按位取反\r\n- 补码:反码+1\r\n\r\n\u003e 反码和补码设计出来就是为了表示负数的,使计算机更好的去计算.\r\n\r\n\r\n对于整型来说,整型在内存中实际上是以「补码」的形式进行存储的.\r\n\u003e 两个整数使用补码进行运算的时候,就可以不关心它们的符号位了,  \r\n\u003e 将它们的位直接相加就好了,就能得到正确的结果.\r\n\r\n\r\n### 整数转换问题\r\n\r\n整数从高位转低位,例如:\r\n\r\n```golang\r\na := int16(256)\r\nb := int8(a)\r\nfmt.Println(b)  // 输出:0\r\n```\r\n\r\n256 int16 在内存存储为:`0000 0001 0000 0000`  \r\n转为 int8 的时候,直接截取8位为:`0000 0000`\r\n\r\n\r\n整数从低位负数转高位正数,例如:\r\n\r\n```golang\r\nc := int8(-8)\r\nd := uint16(c)\r\nfmt.Println(d) // 输出:65528\r\n```\r\n\r\n-8 int8 在内存存储为:`1111 1000`  \r\n转为 uint16 的时候,为:`1111 1111 1111 1000`\r\n\u003e 这里为什么不是 `0000 0000 1111 1000`?  \r\n\u003e 从低位负数转高位正数时,剩余不够的位数会置1,所以是 `1111 1111 1111 1000`  \r\n\u003e 暂时没有找到资料为什么会这样转换\r\n\r\n","author":{"url":"https://github.com/codcodog","@type":"Person","name":"codcodog"},"datePublished":"2022-07-20T13:56:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/133/Blog/issues/133"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ed31efee-b156-7299-ac9e-82df502dc1c6
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9BBE:21F6EA:228FDB:2EA494:6A4C6C8F
html-safe-noncefcb25efd86e6c3a4b1822a184ad3145dd13d3284d78f154b9474d7852babac87
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QkJFOjIxRjZFQToyMjhGREI6MkVBNDk0OjZBNEM2QzhGIiwidmlzaXRvcl9pZCI6IjU2MDMyOTg0OTE3MzQxOTEyNDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd906d07ba0bc5bc09ce9e493b75fe75850e67f3f2fc5996649941bb85691b655
hovercard-subject-tagissue:1311161555
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/codcodog/Blog/133/issue_layout
twitter:imagehttps://opengraph.githubassets.com/5aa22ca3c63c055db55255194e3b774c1b46aa18a019b2567b77119d989b941a/codcodog/Blog/issues/133
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/5aa22ca3c63c055db55255194e3b774c1b46aa18a019b2567b77119d989b941a/codcodog/Blog/issues/133
og:image:alt整型数数据在内存中的存储 基本概念 「机器数」指一个数在计算机中的二进制表示形式. 「机器数」是带符号的,在计算机用一个数的最高位存放符号,正数为0,负数为1. 将带符号位的机器数对应的真正数值称为机器数的「真值」. 例如:0000 0001 的「真值」=> +000 0001 = +1,1000 0001 的「真值」=> -000 0001 = –1 「原码」:将十进制数直接翻译为二进制数...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamecodcodog
hostnamegithub.com
expected-hostnamegithub.com
None3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c
turbo-cache-controlno-preview
go-importgithub.com/codcodog/Blog git https://github.com/codcodog/Blog.git
octolytics-dimension-user_id18098145
octolytics-dimension-user_logincodcodog
octolytics-dimension-repository_id75478736
octolytics-dimension-repository_nwocodcodog/Blog
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id75478736
octolytics-dimension-repository_network_root_nwocodcodog/Blog
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release14099438da5379150f15a2892474c7c7e6c0e55e
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/codcodog/Blog/issues/133#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcodcodog%2FBlog%2Fissues%2F133
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcodcodog%2FBlog%2Fissues%2F133
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=codcodog%2FBlog
Reloadhttps://github.com/codcodog/Blog/issues/133
Reloadhttps://github.com/codcodog/Blog/issues/133
Reloadhttps://github.com/codcodog/Blog/issues/133
codcodog https://github.com/codcodog
Bloghttps://github.com/codcodog/Blog
Notifications https://github.com/login?return_to=%2Fcodcodog%2FBlog
Fork 1 https://github.com/login?return_to=%2Fcodcodog%2FBlog
Star 20 https://github.com/login?return_to=%2Fcodcodog%2FBlog
Code https://github.com/codcodog/Blog
Issues 135 https://github.com/codcodog/Blog/issues
Pull requests 0 https://github.com/codcodog/Blog/pulls
Actions https://github.com/codcodog/Blog/actions
Wiki https://github.com/codcodog/Blog/wiki
Security and quality 0 https://github.com/codcodog/Blog/security
Insights https://github.com/codcodog/Blog/pulse
Code https://github.com/codcodog/Blog
Issues https://github.com/codcodog/Blog/issues
Pull requests https://github.com/codcodog/Blog/pulls
Actions https://github.com/codcodog/Blog/actions
Wiki https://github.com/codcodog/Blog/wiki
Security and quality https://github.com/codcodog/Blog/security
Insights https://github.com/codcodog/Blog/pulse
整型数数据在内存中的存储https://github.com/codcodog/Blog/issues/133#top
Golanghttps://github.com/codcodog/Blog/issues?q=state%3Aopen%20label%3A%22Golang%22
https://github.com/codcodog
codcodoghttps://github.com/codcodog
on Jul 20, 2022https://github.com/codcodog/Blog/issues/133#issue-1311161555
Golanghttps://github.com/codcodog/Blog/issues?q=state%3Aopen%20label%3A%22Golang%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.