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

Numeric shift +> misbehaving on parrot - Dates broken #3387

Closed
p6rt opened this issue May 19, 2014 · 5 comments
Closed

Numeric shift +> misbehaving on parrot - Dates broken #3387

p6rt opened this issue May 19, 2014 · 5 comments
Labels
LHF Low-hanging fruit, easy to resolve

Comments

@p6rt
Copy link

p6rt commented May 19, 2014

Migrated from rt.perl.org#121909 (status was 'resolved')

Searchable as RT121909$

@p6rt
Copy link
Author

p6rt commented May 19, 2014

From @dwarring

Hi There,
Date calculations are currently broken on the parrot backend and have been for about a week, e.g​:

  $ ./perl6-p -e'my $d = Date.new(​:year(2012), :day(1), :month(12)); say ++$d'
  4013-23982-04 # should be 2012-12-02

I've tracked this down to the usage of the bit-shift operator in method ymd-from-daycount in src/core/Temporal.pm, e.g. $day = $day - (36524 * $t + ($t +> 2));

This bug only occurs under specific circumstances. For example​:

my int $t = 10; # needs to be a variable of type int
is (2 * $t) + ($t +> 2), 22; # result is 22 on moar, 4 on parrot

@p6rt
Copy link
Author

p6rt commented May 19, 2014

From @dwarring

A fudged failing test has been added to S03-operators/numeric-shift.t

On Sun May 18 21​:15​:19 2014, david.warring wrote​:

Hi There,
Date calculations are currently broken on the parrot backend and have
been for about a week, e.g​:

$ ./perl6-p -e'my $d = Date.new(​:year(2012), :day(1), :month(12)); say
++$d'
4013-23982-04 # should be 2012-12-02

I've tracked this down to the usage of the bit-shift operator in
method ymd-from-daycount in src/core/Temporal.pm, e.g. $day = $day -
(36524 * $t + ($t +> 2));

This bug only occurs under specific circumstances. For example​:

my int $t = 10; # needs to be a variable of type int
is (2 * $t) + ($t +> 2), 22; # result is 22 on moar, 4 on parrot

@p6rt
Copy link
Author

p6rt commented May 26, 2014

From @masak

<masak> p​: my $d = Date.new(​:year(2012), :day(1), :month(12)); say ++$d
<camelia> rakudo-parrot 166bf3​: OUTPUT«2012-12-02␤»
<masak> seems https://rt.perl.org/Public/Bug/Display.html?id=121909 is fixed?
<gtodd> masak​: https://rt.perl.org/Public/Bug/Display.html?id=121909  doesn't error for me
* masak resolves ticket

@p6rt
Copy link
Author

p6rt commented May 26, 2014

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented May 26, 2014

@masak - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed May 26, 2014
@p6rt p6rt added the LHF Low-hanging fruit, easy to resolve label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LHF Low-hanging fruit, easy to resolve
Projects
None yet
Development

No branches or pull requests

1 participant