]> sourceware.org Git - glibc.git/commitdiff
random: range is not portably RAND_MAX [BZ #7003]
authorJohn Marshall <John.W.Marshall@glasgow.ac.uk>
Tue, 30 Jun 2020 18:16:03 +0000 (14:16 -0400)
committerCarlos O'Donell <carlos@redhat.com>
Tue, 30 Jun 2020 18:20:17 +0000 (14:20 -0400)
On other platforms, RAND_MAX (which is the range of rand(3))
may differ from 2^31-1 (which is the range of random(3)).

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
stdlib/stdlib.h

index f971df424786a7dcd16da03fcd10a8a2ed74068a..3aa27a9d2549b9751b6236e50e3408cd3c72b124 100644 (file)
@@ -397,7 +397,7 @@ extern long int a64l (const char *__s)
    `initstate' and `setstate' functions are those from BSD Unices.
    The `rand' and `srand' functions are required by the ANSI standard.
    We provide both interfaces to the same random number generator.  */
-/* Return a random long integer between 0 and RAND_MAX inclusive.  */
+/* Return a random long integer between 0 and 2^31-1 inclusive.  */
 extern long int random (void) __THROW;
 
 /* Seed the random number generator with the given number.  */
This page took 0.049344 seconds and 5 git commands to generate.