Ticket #1200 (closed RFC: fixed)

Opened 12 years ago

Last modified 11 years ago

sprintf formatting for exponents needs to be standardized

Reported by: coke Owned by: Paul C. Anagnostopoulos
Priority: normal Milestone:
Component: core Version:
Severity: medium Keywords: sprintf
Cc: Language:
Patch status: Platform:


Originally opened by in  http://rt.perl.org/rt3/Ticket/Display.html?id=40823

The original ticket points out that most systems generate 1e+00, while windows generates 1e+000.

Parrot needs to decide on a standard (regardless of OS) and stick with it.

I'll throw out there that we should consider dropping all leading zeros for exponents, using 1e+0 for the given example.

There was never consensus on the original ticket to decide even between the first two options.

Change History

Changed 12 years ago by jkeenan

  • keywords sprintf added
  • component changed from none to core

Changed 11 years ago by Paul C. Anagnostopoulos

  • owner set to Paul C. Anagnostopoulos

I think we should stick with the standard 2-digit exponent. It's almost universal. If people agree, I'll fix this.

Right now the fix-up code is #ifdef'ed on WIN32. I'd be tempted to make it unconditional and work for any number of exponent digits. I'd also add a #define for the default number of digits, `PARROT_SPRINTF_DEFAULT_EXP_DIGITS.

Changed 11 years ago by Paul C. Anagnostopoulos

  • status changed from new to assigned

Changed 11 years ago by Paul C. Anagnostopoulos

  • status changed from assigned to closed
  • resolution set to fixed

We agreed on 2 digits in the #ps conference of 7 Sept. 2010. I have committed this change after making sure it passes fulltest.

Note: See TracTickets for help on using tickets.