Normalize line endings and whitespace
This commit is contained in:

committed by
Andrey Kamaev

parent
0442bca235
commit
81f826db2b
34
3rdparty/openexr/Imath/ImathRandom.cpp
vendored
34
3rdparty/openexr/Imath/ImathRandom.cpp
vendored
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
|
||||
// Digital Ltd. LLC
|
||||
//
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
@@ -17,8 +17,8 @@
|
||||
// distribution.
|
||||
// * Neither the name of Industrial Light & Magic nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
@@ -61,7 +61,7 @@ rand48Next (unsigned short state[3])
|
||||
// sequence,
|
||||
//
|
||||
// x[n+1] = (a * x[n] + c) % m,
|
||||
//
|
||||
//
|
||||
// where a and c are as specified below, and m == (1 << 48)
|
||||
//
|
||||
|
||||
@@ -74,8 +74,8 @@ rand48Next (unsigned short state[3])
|
||||
//
|
||||
|
||||
Int64 x = (Int64 (state[2]) << 32) |
|
||||
(Int64 (state[1]) << 16) |
|
||||
Int64 (state[0]);
|
||||
(Int64 (state[1]) << 16) |
|
||||
Int64 (state[0]);
|
||||
|
||||
//
|
||||
// Compute x[n+1], except for the "modulo m" part.
|
||||
@@ -104,7 +104,7 @@ erand48 (unsigned short state[3])
|
||||
{
|
||||
//
|
||||
// Generate double-precision floating-point values between 0.0 and 1.0:
|
||||
//
|
||||
//
|
||||
// The exponent is set to 0x3ff, which indicates a value greater
|
||||
// than or equal to 1.0, and less than 2.0. The 48 most significant
|
||||
// bits of the significand (mantissa) are filled with pseudo-random
|
||||
@@ -115,17 +115,17 @@ erand48 (unsigned short state[3])
|
||||
// between 1.0 and 1.99999999999999978. Subtracting 1.0 from those
|
||||
// values produces numbers between 0.0 and 0.99999999999999978, that
|
||||
// is, between 0.0 and 1.0-DBL_EPSILON.
|
||||
//
|
||||
//
|
||||
|
||||
rand48Next (state);
|
||||
|
||||
union {double d; Int64 i;} u;
|
||||
|
||||
u.i = (Int64 (0x3ff) << 52) | // sign and exponent
|
||||
(Int64 (state[2]) << 36) | // significand
|
||||
(Int64 (state[1]) << 20) |
|
||||
(Int64 (state[0]) << 4) |
|
||||
(Int64 (state[2]) >> 12);
|
||||
(Int64 (state[2]) << 36) | // significand
|
||||
(Int64 (state[1]) << 20) |
|
||||
(Int64 (state[0]) << 4) |
|
||||
(Int64 (state[2]) >> 12);
|
||||
|
||||
return u.d - 1;
|
||||
}
|
||||
@@ -143,12 +143,12 @@ nrand48 (unsigned short state[3])
|
||||
{
|
||||
//
|
||||
// Generate uniformly distributed integers between 0 and 0x7fffffff.
|
||||
//
|
||||
//
|
||||
|
||||
rand48Next (state);
|
||||
|
||||
return ((long int) (state[2]) << 15) |
|
||||
((long int) (state[1]) >> 1);
|
||||
((long int) (state[1]) >> 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ Rand32::nextf ()
|
||||
{
|
||||
//
|
||||
// Generate single-precision floating-point values between 0.0 and 1.0:
|
||||
//
|
||||
//
|
||||
// The exponent is set to 0x7f, which indicates a value greater than
|
||||
// or equal to 1.0, and less than 2.0. The 23 bits of the significand
|
||||
// (mantissa) are filled with pseudo-random bits generated by
|
||||
@@ -182,7 +182,7 @@ Rand32::nextf ()
|
||||
// point values between 1.0 and 1.99999988. Subtracting 1.0 from
|
||||
// those values produces numbers between 0.0 and 0.99999988, that is,
|
||||
// between 0.0 and 1.0-FLT_EPSILON.
|
||||
//
|
||||
//
|
||||
|
||||
next ();
|
||||
|
||||
|
Reference in New Issue
Block a user