Re: Should rand() return a RAND_MAX value for 32 bit target?

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

 



On 2018-09-18 21:09 +0800, Xi Ruoyao wrote:
> > Tried them on the latest source and observed that the RAND_MAX is generated
> > when
> > the optimization is not enabled. When optimization is enabled for 32 bit
> > target RAND_MAX
> > is not being generated. However, 64 bit generates RAND_MAX with or without
> > optimization.

And I must say, in your program RAND_MAX is NOT generated with Glibc 2.26 on
Linux.  You seen "True" because of floating point rounding error. 

> See https://gcc.gnu.org/wiki/FAQ#PR323.
-- 
Xi Ruoyao <xry111@xxxxxxxxxxxxxxxx>
School of Aerospace Science and Technology, Xidian University




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux