pcg32_next Function

private function pcg32_next(self) result(r)

Next 32-bit output, returned as the int32 with the same bit pattern as the reference implementation’s uint32_t result. Roughly half of the returned values are therefore negative; use next_real_dp or next_below if a magnitude is wanted.

Type Bound

pcg32_t

Arguments

Type IntentOptional Attributes Name
class(pcg32_t), intent(inout) :: self

Return Value integer(kind=int32)


Calls

proc~~pcg32_next~~CallsGraph proc~pcg32_next pcg32_t%pcg32_next proc~pcg32_step pcg32_step proc~pcg32_next->proc~pcg32_step proc~u32_to_int32 u32_to_int32 proc~pcg32_next->proc~u32_to_int32 proc~rotate_right32 rotate_right32 proc~pcg32_step->proc~rotate_right32 proc~u64_add u64_add proc~pcg32_step->proc~u64_add proc~u64_mul u64_mul proc~pcg32_step->proc~u64_mul proc~u64_shr u64_shr proc~pcg32_step->proc~u64_shr

Source Code

   function pcg32_next(self) result(r)
      !! Next 32-bit output, returned as the `int32` with the same bit pattern
      !! as the reference implementation's `uint32_t` result. Roughly half of
      !! the returned values are therefore negative; use `next_real_dp` or
      !! `next_below` if a magnitude is wanted.
      class(pcg32_t), intent(inout) :: self
      integer(int32) :: r

      r = u32_to_int32(pcg32_step(self))
   end function pcg32_next