To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 11061
11060  |  11062
Subject: 
Re: number notation in official parts
Newsgroups: 
lugnet.cad.dev
Date: 
Fri, 12 Mar 2010 19:58:03 GMT
Viewed: 
24146 times
  
In lugnet.cad.dev, Timothy Gould wrote:
Ahhh. I'd never heard of %g before now. I'm so used to %f and %e it had never
occured to me that there might be a mixed option. Handy to know as I suspect it
would be helpful in reading files of unknown format.

All float specifiers (e, E, f, g, G) are treated identically by the scanf
functions.  When scanning floats, they always recognize all float formats.

One other thing about %g on output is that it automatically strips trailing
zeros, which %f doesn't do.  So it can actually be quite useful for printing
things that don't trigger it to go into scientific notation.

--Travis



Message has 1 Reply:
  Re: number notation in official parts
 
(...) Thanks for the info. I've always used perl scripts to convert oddly formatted data to a consistent format and then read it like that. Nice to know I don't always have to. If it could only read some of the more bizarre Fortran formats I'd never (...) (15 years ago, 12-Mar-10, to lugnet.cad.dev, lugnet.off-topic.geek)

Message is in Reply To:
  Re: number notation in official parts
 
(...) Ahhh. I'd never heard of %g before now. I'm so used to %f and %e it had never occured to me that there might be a mixed option. Handy to know as I suspect it would be helpful in reading files of unknown format. I'm sure Delphi has some hideous (...) (15 years ago, 12-Mar-10, to lugnet.cad.dev)

13 Messages in This Thread:





Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR