Renchi Raju <[log in to unmask]> wrote:
> jumping into this thread late (and might have missed bit of it). i
> also find adding floating-point literals is very irritating and prone to
> errors. what is wrong with casting the right hand side expressions'
> floating point literals to the precision of the left hand side
> variable and do it ONLY for the floating point literals. for eg in a case
> like:
> integer, parameter :: SP = selected_real_kind(6,20)
> integer, parameter :: DP = selected_real_kind(14,30)
>
> real(DP) :: a
> real(SP) :: b
> a = sin(3.0)
> b = sin(3.0)
>
> currently one would write this as:
> a = sin(3.0_DP)
> b = sin(3.0_SP)
>
> why not just use whats expected on the lhs and properly cast the literals
> on the rhs to the required precision to whats needed.
This was the essence of the proposal in J3 meeting 167 paper
http://j3-fortran.org/doc/meeting/167/04-125.ps, which was considered at
J3 meeting 167 last week, and then NOT put onto the list of proposals that
J3 will advocate WG5 should consider further.
There is a spreadsheet of proposals, with terse titles and dispositions, in
http://j3-fortran.org/doc/meeting/167/04-265.xls. On Linux, Open Office can
view this spreadsheet. In Windows, use Excel. The list of dispositions isn't
complete.
--
Van Snyder | What fraction of Americans believe
[log in to unmask] | Wrestling is real and NASA is fake?
Any alleged opinions are my own and have not been approved or disapproved
by JPL, CalTech, NASA, Sean O'Keefe, George Bush, the Pope, or anybody else.
|