[J3] Leading zeroes

Van Snyder van.snyder at jpl.nasa.gov
Sun Nov 4 22:00:02 EST 2018


For zero-padding integers, we added .n  The obvious parallel extension
for zero-adding real numbers is to add .n, e.g. SP,f6.2.5
to solve the problem in the example from Steve's correspodent.

But it's a bit late to add new stuff, while rejecting old stuff that has
had wide support for decades but never seems to survive the priority
squeeze.

On Sun, 2018-11-04 at 20:19 -0500, Steve Lionel via J3 wrote:
> I just received this from a long-time user I am familiar with.
> Unfortunately I don't see a way to incorporate his request without
> radical new syntax (F5.2.5 ?) or breaking existing code. (I also
> referenced 18-268.)
> 
> 
> Steve
> 
> Coordinating w/others has never been my strong suit, so watching
> something this complex coalesce simply seems like magic to me…
> Perhaps especially so because Fortran has been around for over 60
> years, and adding new capabilities while still honoring the original
> syntax is magic (as some might think it impossible!).
> 
>  
> 
> I do see a lot on the table, so I suspect it will get tough when it
> comes time to nail it down and commit – as you’ve said before,
> processor “vendors” cannot adopt everything at once so picking the
> right-sized feature set for the next standard is a balancing act – add
> too much and compilers will lag – too little and Fortran will suffer.
> In short, Godspeed!
> 
>  
> 
> Re J3/18-120r3,  a small suggestion.  Just now I was trying to
> zero-pad a floating point number (with +/- sign), but I had to do
> “string gymnastics” with 4-5 lines of code to make it happen.  It’s
> not much burden, and my use case is likely limited, but while your
> team considers this “leading zero” issue in 18-120, perhaps there is a
> generalization of the proposed format change that includes (real
> number) zero-padding, similar to integer such as “I4.4”.  In my case,
> I was in need of 5 characters w/sign and leading zeros (e.g. “+01.14”,
> “-10.33”, “-00.03”, “+00.94”), so I had to use “SP,F0.2” and then
> adjust the resulting string.
> 
>  
> 




More information about the J3 mailing list