FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 04-24-2011, 02:54 AM
"Michael D. Berger"
 
Default random roundoff?

On my CentOS 5 box, in a C++ program that does much arithmetic,
including numerous matrix multiplications, I have a situation in
in which the result depends on the nature of nearby I/O. Thus,
with all arithmetic done with type double, and where values
are mostly in the range [-1.0e0,+1.0e0] or nearby, I do:

cerr << "some stuff" << endl;
mat3 = matmult(mat1,mat2);

I get a difference of the order 1.0e-15 depending on whether the
cerr line does or does not end in "endl" as shown.

I am imagining that there is some "randomness" in the roundoff
that depends on the I/O situation. Is this credible? Any other
suggestions?

Thanks for your help,
Mike.

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 04-24-2011, 12:50 PM
Leonard den Ottolander
 
Default random roundoff?

Hello Michael,

On Sun, 2011-04-24 at 02:54 +0000, Michael D. Berger wrote:
> cerr << "some stuff" << endl;
> mat3 = matmult(mat1,mat2);
>
> I get a difference of the order 1.0e-15 depending on whether the
> cerr line does or does not end in "endl" as shown.

If the exact same input produces different results depending on whether
or not you add and endl before the function call would probably count as
a bug. Could be something like a status bit that does not get cleared
when it should be.

However, since this is such a gcc specific issue I would suggest you
take this upstream: http://gcc.gnu.org/lists.html . People there will
probably be able to help you better than the people on this list.

Regards,
Leonard.

--
mount -t life -o ro /dev/dna /genetic/research


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 04-26-2011, 03:19 PM
Todd Rinaldo
 
Default random roundoff?

On Apr 23, 2011, at 9:54 PM, Michael D. Berger wrote:On my CentOS 5 box, in a C++ program that does much arithmetic,
including numerous matrix multiplications, I have a situation in
in which the result depends on the nature of nearby I/O. *Thus,
with all arithmetic done with type double, and where values
are mostly in the range [-1.0e0,+1.0e0] *or nearby, I do:

**cerr << "some stuff" << endl;
**mat3 = matmult(mat1,mat2);

I get a difference of the order 1.0e-15 depending on whether the
cerr line does or does not end in "endl" as shown.

I am imagining that there is some "randomness" in the roundoff
that depends on the I/O situation. *Is this credible? *Any other
suggestions?

Thanks for your help,
Mike.

Mike, I think I'm understanding your problem. This just sounds like a floating point rounding issue.
You've read the floating point bible already?http://download.oracle.com/docs/cd/E19957-01/806-3568/ncg_goldberg.html
Todd______________________________________________ _
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 07:33 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org