Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value range propogation applied incorrectly. #17685

Open
dlangBugzillaToGithub opened this issue Oct 18, 2014 · 1 comment
Open

Value range propogation applied incorrectly. #17685

dlangBugzillaToGithub opened this issue Oct 18, 2014 · 1 comment
Labels

Comments

@dlangBugzillaToGithub
Copy link

gordon.freeman.sullied reported this on 2014-10-18T17:49:00Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=13634

Description

long a = 0;
long b = 9223372036854775807;
	
a = cast(double) b;
writeln(b);
writeln(a);


The results are:
b = 9223372036854775807
a = -9223372036854775808

This should not be possible.
@dlangBugzillaToGithub
Copy link
Author

gordon.freeman.sullied commented on 2014-10-18T17:52:14Z

In the case of a large negative or positive value stored in a long, an intermediate double will not fully store it, therefore this should not be possible without more explicit means.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant