forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

No E format in Clearwin

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Suggestions
View previous topic :: View next topic  
Author Message
DanRRight



Joined: 10 Mar 2008
Posts: 1554
Location: South Pole, Antarctica

PostPosted: Mon Sep 04, 2017 5:39 am    Post subject: No E format in Clearwin Reply with quote

Only humanoids can comprehend large output numbers like this done with %rf

59813784709

which is approximately 5.98e10. But there is no Ex.y format in Clearwin. Can this be added?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 4920
Location: Salford, UK

PostPosted: Mon Sep 04, 2017 6:35 am    Post subject: Reply with quote

I will add this to the wish list.
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 1654
Location: Yateley, Hants, UK

PostPosted: Mon Sep 04, 2017 10:57 am    Post subject: Reply with quote

Dan,

My guess is that it is required on output not input, in which case it can be written to a character variable first.

If you really do need it for input, then you can presumably input the the powers of 10 separately from the decimal part in an %rf and a %rd. That also works better with %il, as each box would have its own 2 limits - an E format box needs 4.

Eddie
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 1554
Location: South Pole, Antarctica

PostPosted: Mon Sep 04, 2017 12:11 pm    Post subject: Reply with quote

Thanks you Paul and Eddie, I played further and I think the problem can be more or less satisfactory solved if force %rf to use smaller amount of digits, i.e. use %7rf instead of %rf if this variable intended only for the output. See example below (of course full fledged Ex.y format would be better)

Also I had some problems with %wf, why I use %rf 1000x more often. May be I do something wrong with it. Look at this text sample, the %wf does not react on number of digits

Code:
   real*8 x
   x= 12345678901.123456789

   i = winio@('X   rf %ta%rf %ff&', x)
   i = winio@('X  7rf %ta%7rf%ff&', x)
   i = winio@('X  8rf %ta%8rf%ff&', x)
   i = winio@('X  9rf %ta%9rf%ff&', x)
   i = winio@('X 10rf %ta%10rf%ff&',x)
   i = winio@('X 11rf %ta%11rf%ff&',x)
   i = winio@('X 12rf %ta%12rf%ff&',x)

   i = winio@('X   wf %ta%wf %ff&', x)
   i = winio@('X  7wf %ta%7wf%ff&', x)
   i = winio@('X  8wf %ta%8wf%ff&', x)
   i = winio@('X  9wf %ta%9wf%ff&', x)
   i = winio@('%es')
end


Another hopefully small problem is that despite Real*8 declaration for X both %rf and %wf treat X as single precision
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 732

PostPosted: Mon Sep 04, 2017 7:41 pm    Post subject: Reply with quote

Add "D0" to the end of the second line.

Without that, or some other way of signifying that the value is double precision, the decimal number is first converted to a 32-bit REAL, which causes some digits to be lost, and then converted to 64-bit REAL on assignment.
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 1554
Location: South Pole, Antarctica

PostPosted: Tue Sep 05, 2017 6:38 am    Post subject: Reply with quote

As to accuracy you are right, Mecej4. Since i am stepping on the same rake already 1000 times i suggest developers to make the following "Warning: such assignment of variable X will lead to the lose of accuracy because by default the values without explicit descriptors are cut to single precision even if declared as double precision. To fix this use double precision descriptor like in 1.23D0" (I like verbose warning and comments, they are less cryptic)

Last edited by DanRRight on Tue Sep 05, 2017 10:29 am; edited 2 times in total
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 4920
Location: Salford, UK

PostPosted: Tue Sep 05, 2017 6:47 am    Post subject: Reply with quote

I have made a note of this.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Suggestions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group