Title: wrong precision for floats · Issue #59 · kframework/java-semantics · GitHub
Open Graph Title: wrong precision for floats · Issue #59 · kframework/java-semantics
X Title: wrong precision for floats · Issue #59 · kframework/java-semantics
Description: Some of my tests showed that K-Java has a wrong precision for float values. I assume that float values were just encoded as double precision values. As a result, I could observe that in some calculations, K-Java produces results that sig...
Open Graph Description: Some of my tests showed that K-Java has a wrong precision for float values. I assume that float values were just encoded as double precision values. As a result, I could observe that in some calcul...
X Description: Some of my tests showed that K-Java has a wrong precision for float values. I assume that float values were just encoded as double precision values. As a result, I could observe that in some calcul...
Opengraph URL: https://github.com/kframework/java-semantics/issues/59
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"wrong precision for floats","articleBody":"Some of my tests showed that K-Java has a wrong precision for float values. I assume that float values were just encoded as double precision values. \r\nAs a result, I could observe that in some calculations, K-Java produces results that significantly diverge from the results of Java. Moreover, K-Java sometimes produces a concrete value, whereas Java returns Infinity, which is shown in the following example:\r\n```\r\nfloat a = (float) 1 - 1473150328275393513L / 0.16f * 6854191149854506640L * -128033296 * 23412341234123414L;\r\nSystem.out.println(\"\" + a); //K-Java shows 1.8916947877681303e+62, Java shows Infinity\r\n\r\ndouble b = (double) 1 - 1473150328275393513L / 0.16 * 6854191149854506640L * -128033296 * 23412341234123414L;\r\nSystem.out.println(\"\" + b); //K-Java and Java shows 1.8916947877681303e+62\r\n```\r\nAdditionally, I noticed that K-Java wrongly represents the infinity value (e.g. -Infinity.0) of double or float calculations and also the exponent representation is a bit different to Java.","author":{"url":"https://github.com/rschumi0","@type":"Person","name":"rschumi0"},"datePublished":"2020-02-29T23:53:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/59/java-semantics/issues/59"}
| 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:83f18dfa-7768-79db-014d-0a2e2b5448a1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9F86:33A48C:1641467:1D5985D:697191AA |
| html-safe-nonce | 1a6ccadc91544f4c74dbffd5596f81b75ebb09e1ad7b8a1a9d44ceb7ebda8fc0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Rjg2OjMzQTQ4QzoxNjQxNDY3OjFENTk4NUQ6Njk3MTkxQUEiLCJ2aXNpdG9yX2lkIjoiODE5ODI0Mjg4Nzg2Mjk0ODI2NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8ac7a1a71ef2d74627f4ca9de0088714ac5a9e792b81923b5bd72c13dc02303c |
| hovercard-subject-tag | issue:573433387 |
| 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/59/issue_layout |
| twitter:image | https://opengraph.githubassets.com/563a756d8c0c17594254cff8b53760ae65f3f5ec45eb7ebc7ab0f05d5327918e/kframework/java-semantics/issues/59 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/563a756d8c0c17594254cff8b53760ae65f3f5ec45eb7ebc7ab0f05d5327918e/kframework/java-semantics/issues/59 |
| og:image:alt | Some of my tests showed that K-Java has a wrong precision for float values. I assume that float values were just encoded as double precision values. As a result, I could observe that in some calcul... |
| 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