Title: casting a floating-point number to an integer · Issue #64 · kframework/java-semantics · GitHub
Open Graph Title: casting a floating-point number to an integer · Issue #64 · kframework/java-semantics
X Title: casting a floating-point number to an integer · Issue #64 · kframework/java-semantics
Description: There seems to be an issue when a cast is performed from a floating-point number that is larger than the maximum Integer to an Integer. In this case, the value should just be the largest Integer as documented in Section 5.1.3 of the JLS....
Open Graph Description: There seems to be an issue when a cast is performed from a floating-point number that is larger than the maximum Integer to an Integer. In this case, the value should just be the largest Integer as...
X Description: There seems to be an issue when a cast is performed from a floating-point number that is larger than the maximum Integer to an Integer. In this case, the value should just be the largest Integer as...
Opengraph URL: https://github.com/kframework/java-semantics/issues/64
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"casting a floating-point number to an integer","articleBody":"There seems to be an issue when a cast is performed from a floating-point number that is larger than the maximum Integer to an Integer. In this case, the value should just be the largest Integer as documented in [Section 5.1.3 of the JLS](https://docs.oracle.com/javase/specs/jls/se7/html/jls-5.html#jls-5.1.3).\r\nHowever, K-Java performs this cast in the same way as a long to int cast as illustrated by the following example.\r\n```\r\nSystem.out.println(((int)2147483648L));\r\nSystem.out.println(((int)2147483648.0)); // should be 2147483647\r\n```\r\nThe same issue also occurs for a cast to other data types when floating-point numbers are involved.","author":{"url":"https://github.com/rschumi0","@type":"Person","name":"rschumi0"},"datePublished":"2020-06-01T23:14:14.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/64/java-semantics/issues/64"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2b1ddc7c-da0b-166f-447b-9fc06d4052ce |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C8B0:2D1CC6:141BBEF:1A6C521:69718B89 |
| html-safe-nonce | a73de83f5f894da9884590849e8da4826b49a89713104557ccd8c00b20a172b3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOEIwOjJEMUNDNjoxNDFCQkVGOjFBNkM1MjE6Njk3MThCODkiLCJ2aXNpdG9yX2lkIjoiMzQ0MTgwODI0NjY5Nzk4Njk1MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8c3ca0d3841f0b1192b533dfd13eb58779ce90277517fa7f47be5a5f6a818a01 |
| hovercard-subject-tag | issue:628787237 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/kframework/java-semantics/64/issue_layout |
| twitter:image | https://opengraph.githubassets.com/04ca9aa738a5ff4d50b0019159f51113f22d8e2142aa3ae02c87f24f1ca6f4df/kframework/java-semantics/issues/64 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/04ca9aa738a5ff4d50b0019159f51113f22d8e2142aa3ae02c87f24f1ca6f4df/kframework/java-semantics/issues/64 |
| og:image:alt | There seems to be an issue when a cast is performed from a floating-point number that is larger than the maximum Integer to an Integer. In this case, the value should just be the largest Integer as... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rschumi0 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2b0f2f00499ad3dd2c21ad030a3c403edca54df20ea256f6517c6d8c4fa3a1a4 |
| turbo-cache-control | no-preview |
| go-import | github.com/kframework/java-semantics git https://github.com/kframework/java-semantics.git |
| octolytics-dimension-user_id | 5104335 |
| octolytics-dimension-user_login | kframework |
| octolytics-dimension-repository_id | 11711471 |
| octolytics-dimension-repository_nwo | kframework/java-semantics |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 11711471 |
| octolytics-dimension-repository_network_root_nwo | kframework/java-semantics |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 67235153f3c1514ed5f7dc469f138abc377bd388 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width