bugGNU Astronomy Utilities - Bugs: bug #61940, Numbers with many decimals...


You are not allowed to post comments on this tracker with your current authentication level.

bug #61940: Numbers with many decimals incorrectly been read as float32

Submitter:  Mohammad Akhlaghi <makhlaghi>
Submitted:  Wed 26 Jan 2022 11:11:37 PM UTC
Category:  Libraries Severity:  3 - Normal
Item Group:  Output not reasonable Status:  Fixed
Privacy:  Public Assigned to:  makhlaghi
Open/Closed:  Closed

Wed 26 Jan 2022 11:28:34 PM UTC, comment #1: 

This bug has been fixed in Commit 9f1c1542cb.

Mohammad Akhlaghi <makhlaghi>
Project Administrator
Wed 26 Jan 2022 11:11:37 PM UTC, original submission:  

When a many-digit "small" number (like '330624.3918430004') is given to 'gal_type_string_to_number', it is mistakenly read as a 32-bit float number, not 64-bit.

This causes problems like the example below (when reading FITS keywords that have values in a similar format). This 'img.fits' can be any of the images that is initially downloaded in the general tutorial:

$ astfits img.fits -h0 --keyvalue=TEXPTIME
img.fits 330624

$ astfits img.fits -h0 | grep TEXPTIME
TEXPTIME=    330624.3918430004

As you see, while the value is '330624.3918430004', the Fits program only prints the first 6 characters! The root cause of this problem is that 'gal_type_string_to_number' is wrongly identifying this as a 32-bit floating point number.

This bug was first reported by Zohre Ghaffari and Pedram Ashofteh Ardakani helped in finding the solution.

Mohammad Akhlaghi <makhlaghi>
Project Administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by makhlaghi (Submitted the item)
  • -email is unavailable- added by makhlaghi
  • -email is unavailable- added by makhlaghi

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.




    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-01-26 makhlaghi StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2022-01-26 makhlaghi Carbon-Copy- Added -email is unavailable-
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.11