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

Cannot assign ULLONG_MAX (i.e. 18446744073709551615) to the ulonglong variable. #5717

Open
p6rt opened this issue Oct 2, 2016 · 1 comment

Comments

@p6rt
Copy link

p6rt commented Oct 2, 2016

Migrated from rt.perl.org#129785 (status was 'new')

Searchable as RT129785$

@p6rt
Copy link
Author

p6rt commented Oct 2, 2016

From @titsuki

See the following results​:

$ gcc ulonglong.c
$ ./a.out
unsigned long long max​: 18446744073709551615

$ perl6 -MNativeCall -e 'my ulonglong $a = 18446744073709551615; say $a;'
-1

$ perl6 -MNativeCall -e 'my longlong $a = 18446744073709551615; say $a;'
-1

ulongulong.c


#include <stdio.h>
#include <limits.h>

int main(){
  printf("unsigned long long max​: %llu\n", ULLONG_MAX);
}


It seems wrong to me, because ulonglong behaves like longlong and returns signed variables.

$ perl6 --version
This is Rakudo version 2016.09-105-g4abc28c built on MoarVM version 2016.09-13-g34c375a
implementing Perl 6.c.

$ gcc --version
gcc (Debian 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

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

No branches or pull requests

1 participant