[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #62710] Plain-text integers starting with 0 are read in the octal b
From: |
Mohammad Akhlaghi |
Subject: |
[bug #62710] Plain-text integers starting with 0 are read in the octal base |
Date: |
Tue, 5 Jul 2022 10:56:55 -0400 (EDT) |
URL:
<https://savannah.gnu.org/bugs/?62710>
Summary: Plain-text integers starting with 0 are read in the
octal base
Project: GNU Astronomy Utilities
Submitter: makhlaghi
Submitted: Tue 05 Jul 2022 03:56:53 PM BST
Category: Libraries
Severity: 3 - Normal
Item Group: Output not reasonable
Status: In Progress
Privacy: Public
Assigned to: makhlaghi
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Tue 05 Jul 2022 03:56:53 PM BST By: Mohammad Akhlaghi <makhlaghi>
Currently, when a plain-text integer starts with a zero (which happens
sometimes due to zero-padding to have a fixed number of characters).
Gnuastro's text-reading library will interpret it as an octal base (which is
common in computer science).
The problem can be reproduced with a simple table where the column is defined
to be an integer (the number 164 is the integer value when interpreting "0420"
in octal base).
$ cat test.txt
# Column 1: id [counter ,uint8] test
0420
$ asttable test.txt
164
This problem was reported by Manuel Sánchez-Benavente (in the context of
reading FITS keywords, but the origin of the problem is the same as above,
which is easier to reproduce).
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?62710>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [bug #62710] Plain-text integers starting with 0 are read in the octal base,
Mohammad Akhlaghi <=