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

Internal Parrot error when parsing a number in scientific notation with very many decimals in Rakudo #1721

Closed
p6rt opened this issue Apr 24, 2010 · 6 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Apr 24, 2010

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

Searchable as RT74640$

@p6rt
Copy link
Author

p6rt commented Apr 24, 2010

From @masak

<moritz_> rakudo​: 3.14159265358979323846264338327950288419716939937510e0
<p6eval> rakudo 06fe9a​: OUTPUT«Multiple Dispatch​: No suitable
candidate found for 'multiply_float', with signature 'PNP->P' [...]
<masak> I s'pose that's a known, reported bug?
<moritz_> no idea
<moritz_> don't think so
* masak submits it, then

@p6rt
Copy link
Author

p6rt commented Jul 28, 2010

From @coke

On Sat Apr 24 12​:55​:39 2010, masak wrote​:

<moritz_> rakudo​: 3.14159265358979323846264338327950288419716939937510e0
<p6eval> rakudo 06fe9a​: OUTPUT«Multiple Dispatch​: No suitable
candidate found for 'multiply_float', with signature 'PNP->P' [...]
<masak> I s'pose that's a known, reported bug?
<moritz_> no idea
<moritz_> don't think so
* masak submits it, then

Behaves different in REPL/evalbot​:

$ ./perl6

3.14159265358979323846264338327950288419716939937510e0
3.14159265358979

but​:

22​:16 < [Coke]> rakudo​:
3.14159265358979323846264338327950288419716939937510e0
22​:16 <+p6eval> rakudo 7f5c22​: ( no output )

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jul 28, 2010

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

@p6rt
Copy link
Author

p6rt commented Jul 28, 2010

From @coke

On Tue Jul 27 19​:17​:07 2010, coke wrote​:

On Sat Apr 24 12​:55​:39 2010, masak wrote​:

<moritz_> rakudo​: 3.14159265358979323846264338327950288419716939937510e0
<p6eval> rakudo 06fe9a​: OUTPUT«Multiple Dispatch​: No suitable
candidate found for 'multiply_float', with signature 'PNP->P' [...]
<masak> I s'pose that's a known, reported bug?
<moritz_> no idea
<moritz_> don't think so
* masak submits it, then

Behaves different in REPL/evalbot​:

$ ./perl6

3.14159265358979323846264338327950288419716939937510e0
3.14159265358979

but​:

22​:16 < [Coke]> rakudo​:
3.14159265358979323846264338327950288419716939937510e0
22​:16 <+p6eval> rakudo 7f5c22​: ( no output )

oh, duh, need to print the value for the evalbot​:

22​:45 < [Coke]> rakudo​:
  3.14159265358979323846264338327950288419716939937510e0.perl.say
22​:45 <+p6eval> rakudo 7f5c22​: OUTPUT«3.14159265358979␤»

Per colomon++, this is functioning to spec. Assigning to him for spectesting. (virtually. he
doesn't have an account on RT, so assigning to moritz).

22​:47 < colomon> yes. the e0 at the end means it's a Num, which is
  machine-precision.
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jul 30, 2010

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

@p6rt p6rt closed this as completed Jul 30, 2010
@p6rt
Copy link
Author

p6rt commented Jul 30, 2010

From @kyleha

This is an automatically generated mail to inform you that tests are now available in at least one of these files​: misc/evalbot/lib/EvalbotExecuter.pm, t/spec/S02-literals/numeric.t

commit 624bf715b6698f6e3c6b722f02ae933502241eca
Author​: moritz <moritz@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Fri Jul 30 18​:07​:55 2010 +0000

  [t/spec] test for RT #​74640, very long Num literals
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;31876 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/misc/evalbot/lib/EvalbotExecuter.pm b/misc/evalbot/lib/EvalbotExecuter.pm
index ea71c6d..c9960b4 100644
--- a/misc/evalbot/lib/EvalbotExecuter.pm
+++ b/misc/evalbot/lib/EvalbotExecuter.pm
@@ -102,9 +102,9 @@ sub _fork_and_eval {
     if (!defined $fork_val){
         confess "Can't fork(): $!";
     } elsif ($fork_val == 0) {
-        local $SIG{ALRM} = sub { close $fh; exit 14 };
+        local $SIG{ALRM} = sub {print $fh "(timeout)"; close $fh; exit 14 };
         _set_resource_limits();
-        alarm 14;
+        alarm 12;
         _auto_execute($executer, $program, $fh, $filename);
         alarm 0;
         close $fh;
@@ -163,7 +163,6 @@ sub _auto_execute {
 sub _set_resource_limits {
 # stolen from evalhelper-p5.pl
     setrlimit RLIMIT_CPU,  15, 20                    or confess "Couldn't setrlimit: $!\n";
-    alarm 15;
 #    setrlimit RLIMIT_VMEM,  500 * 2**20, 200 * 2**20 or confess "Couldn't setrlimit: $!\n";
 # STD.pm has a lexing subdir, varying in size, so allow 15MB
     my $size_limit = 15 * 1024**2;
diff --git a/t/spec/S02-literals/numeric.t b/t/spec/S02-literals/numeric.t
index 55b1e0f..135fb87 100644
--- a/t/spec/S02-literals/numeric.t
+++ b/t/spec/S02-literals/numeric.t
@@ -27,6 +27,10 @@ isa_ok 1+1i, Complex, '1+1i is a Complex literal';
 ok 1+1i ~~ Numeric, '1+1i is Numeric';
 nok 1+1i ~~ Real, '1+1i is not Real';
 
+# RT #74640
+is_approx 3.14159265358979323846264338327950288419716939937510e0,
+          3.141592, 'very long Num literals';
+
 done_testing;
 
 # vim: ft=perl6 sw=4 ts=4 expandtab

@p6rt p6rt added the Bug label Jan 5, 2020
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