Bug 332971 - scientific notation bug in genius
Summary: scientific notation bug in genius
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: genius
Version: 7
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Gérard Milmeister
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-10-15 18:19 UTC by George Lebl
Modified: 2007-11-30 22:12 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2007-11-07 19:23:48 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
patch to fix scientific notation printing (388 bytes, patch)
2007-10-16 15:36 UTC, George Lebl
no flags Details | Diff

Description George Lebl 2007-10-15 18:19:18 UTC
Description of problem:

scientific notation screws up on output.  To test enter a large number into
genius for example 123123123123123123.0 (just anything with more digits than
MaxDigits, which is 12 by default) and you get some nonsense such as for the
above I get e17, instead of 1.23123123123e17

The problem is in the output routine using sprintf in a very funky way which
used to work (I admit it was stupid of me to do that but I wrote that code 10
years ago when I was young and stupid).  Anyway, upstream v 1.0.0 fixes this,
and I can also provide a simple patch to fix the problem.  I can't do that right
now but when I get home.

Comment 1 George Lebl 2007-10-16 15:36:58 UTC
Created attachment 228881 [details]
patch to fix scientific notation printing

A patch to fix the scientific notation printing.  Yes the code is not prettiest
but its correct now.  The problem was that sprintf used to allow the string
itself to be a parameter allowing something like sprintf(s,"%s...",s,...) but
that no longer works with recent gcc optimizations apparently.


Note You need to log in before you can comment on or make changes to this bug.