efp_from_real Function

public pure function efp_from_real(r) result(a)

real64 -> efp_t. Wraps efp_decompose; unlike the pre-fix version, the NaN / overflow flags are NOT discarded – they seed a%poison (nonzero iff is_nan .or. is_ovf), so a poisoned summand still taints every later efp_plus/efp_to_real even though the flags themselves aren’t returned here (callers needing the raw flags call efp_decompose directly).

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: r

Return Value type(efp_t)


Calls

proc~~efp_from_real~~CallsGraph proc~efp_from_real efp_from_real proc~efp_decompose efp_decompose proc~efp_from_real->proc~efp_decompose

Called by

proc~~efp_from_real~~CalledByGraph proc~efp_from_real efp_from_real proc~ocean_console_stats_report ocean_console_stats_report proc~ocean_console_stats_report->proc~efp_from_real proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~ocean_console_stats_report proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean

Variables

Type Visibility Attributes Name Initial
logical, private :: is_nan
logical, private :: is_ovf

Source Code

   pure function efp_from_real(r) result(a)
      !! `real64 -> efp_t`.  Wraps `efp_decompose`; unlike the pre-fix
      !! version, the NaN / overflow flags are NOT discarded -- they seed
      !! `a%poison` (nonzero iff `is_nan .or. is_ovf`), so a poisoned
      !! summand still taints every later `efp_plus`/`efp_to_real` even
      !! though the flags themselves aren't returned here (callers needing
      !! the raw flags call `efp_decompose` directly).
      real(real64), intent(in) :: r
      type(efp_t) :: a
      logical :: is_nan, is_ovf
      call efp_decompose(r, a%v, is_nan, is_ovf)
      a%poison = merge(1_int64, 0_int64, is_nan .or. is_ovf)
   end function efp_from_real