On Tue, 5 Mar 2019, Paul Cassella wrote:
The value seems to work when it's available to cbrt() as a param (or
literal as in Brad's example):
fortytwo@magrathea:~/src/chapel (master)$ cat realweird.chpl
param x = 0x1.0p-1044;
var y = x;
writeln("chapel var : ", cbrt(y) == 0x1.0p-348);
writeln("chapel param : ", cbrt(x) == 0x1.0p-348);
writeln("chapel literal: ", cbrt(0x1p-1044) == 0x1.0p-348);
fortytwo@magrathea:~/src/chapel (master)$ ./realweird -nl 1
chapel var : false
chapel param : true
chapel literal: true
I get the same results when compiling with -O, or with --fast, or with
neither.
Paul,
I copied your code into a file 'paul.chpl'. I ran unoptimized and matched
yours, i.e. the weird behaviour. But optimized, it behaves properly. Note
that I get that with 1.16.0 or 1.18.0 latest versions of the compiler,
pulled down from Github a a week ago. I have a GCC backend.
$ chpl paul.chpl ; ./paul ; chpl -O paul.chpl ; ./paul
<email comments> start of unoptimized version
chapel var : false
chapel param : true
chapel literal: true
<email comments> start of optimized version
chapel var : true
chapel param : true
chapel literal: true
All very strange.
Regards - Damian
Pacific Engineering Systems International, 277-279 Broadway, Glebe NSW 2037
Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here
Views & opinions here are mine and not those of any past or present employer
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers