-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adstring outputs wrong string with negative zero #57
Comments
I want to work on this issue, how should I get started? I already have build AstroLib and tried to modify according to the suggestion mentioned (though rebuilding the pkg doesn't reflect it). |
I don't know what you mean by "I have already build AstroLib", but the best way to work on a Julia package is to
or in short
This will have created a git clone of this repository under your Once you're done with the changes, you can submit a pull request here. Note that it's always good practice to add new tests in a pull request which is fixing a bug. Let me know if you need more guidance about how to open a pull request. |
I looked into the problem and found that the above suggestion by G-Francio requires just int casting to produce the correct output. The first one is his output and second one is mine after modifying
The modified line: I have tried it for several tests, it is good looking for every case. Also, we can use just
It maybe a help to know if there is any guidelines for pull requests, or just I create a new branch (Pushing the |
@giordano it would be great of you if you could provide some feedback on this and also contribution practices you follow. I would be glad to work on any other issue also, if you could point it out. |
Yes, that's absolutely fine. We can discuss the details of the implementation in the pull request |
Adstring outputs the wrong string when dec starts with negative zero (i.e. -0.5), while radec converts correctly.
The bug seems to be this line in
adstring.jl
:which ignores the negative zero.
A possible fix (although, since I'm a beginner, probably not a reliable one) could be:
dec_string = (dec > 0 ? "+" : "-") * @sprintf("%02.2d %02d %s", abs(dec_deg), dec_min, dec_sec_string)
The text was updated successfully, but these errors were encountered: