Re: Exponent Format specifiers for %g
Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance
"Buddy Lott" <buddylott@xxxxxxxxxxxxx> wrote in message
news:A71164D9-750F-4814-A077-65469A83D4E3@xxxxxxxxxxxxx
Does anyone know if you can specify how many digits are displayed in
the exponent field when you use the %g format specifier?
No. When scientific notation is chosen, %g behaves like %e. The standard
has this to say about %e: "The exponent always contains at least two
digits, and only as many more digits as necessary to represent the
exponent."
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
Relevant Pages
- Re: Exponent Format specifiers for %g
... provide a consitent output format with 3 digits of the exponent. ... It is not consistent with the ANSI standard for printf. ... fails to conform to C99, ... (microsoft.public.vc.language) - Re: BigNum -- Floating Point
... The 'N' is the number of decimal digits. ... The internal representation is really just a string of bits. ... the number of shifts for various multiples of ten: ... The 'exponent' is very closely related to ... (comp.programming) - Re: Another question about big floating point
... digits to the right of the radix point (so the numbers above have ... really add much cost to the addition/subtraction/etc. ... point when you use 2 as base for the exponent. ... shift plus the addition itself). ... (comp.programming) - Re: Very small numbers & formatting
... full exponent can be shown. ... The case in standard is slightly more restrictive than this. ... If you explicitly specify the exponent width, ... more than 3 digits of exponent. ... (comp.lang.fortran) - Re: format with G descriptor
... m is the minimum number of digits that must be in the field ... e is the number of digits in the exponent ... assigns input data in the same way as the F data edit descriptor. ... list element.What a compiler does if you don't follow this might ... (comp.lang.fortran) |
|