Re: C++ compilers on Linux supporting 64bit architecture?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> >  float x = pow( 10, -6 );
> >
> > on linux this gives you 1e-6. On windows you get 0 !!
>
> You do?  I don't.  Not with VC++-2005 and not with gcc in Cygwin.  I get
> 1e-6 on every platform I've tried so far.  How did you do that
> experiment?

I didn't do it myself, I must confess. It was reported be a work colleague 
recently who was trying to iron out differences in an application between 
linux (gcc3.4.6 on SLC4) and windows (vc++ 7.1, so the '2003' one). 

I guess the problem must have been fixed between VC 2003 and 2005 ?

>
> > std::sort( .... ); The STL standard states that for elements that are
> > "equal" (whatever that means for the predicate) the final order is not
> > defined. Anything which is not defined in the standard you can read as
> > possibly platform dependant. IN this case the fix is easily, as
> > std::stable_sort(...) is for exactly this case, as in preserve the
> > original order of 'equal' elements.
>
> That's true anywhere.  "Undefined" means t's not even guaranteed that
> you get the same output for two successive runs of the same program on
> the same machine.

Agreed. Although in this case we hadn't noticed any repeatability problems, 
but that must likely just luck. In general don't rely on any undefined 
behavior. My point was its easy to not realize you are using some undefined 
behavior, until you compare two different compilers etc.

Chris


-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux