unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Zefram <zefram@fysh.org>
To: 21906@debbugs.gnu.org
Subject: bug#21906: julian-day->date negative input breakage
Date: Fri, 13 Nov 2015 14:31:04 +0000	[thread overview]
Message-ID: <20151113143104.GP13455@fysh.org> (raw)

scheme@(guile-user)> (use-modules (srfi srfi-19))
scheme@(guile-user)> (julian-day->date 0 0)
$1 = #<date nanosecond: 0 second: 0 minute: 0 hour: 12 day: 24 month: 11 year: -4714 zone-offset: 0>
scheme@(guile-user)> (julian-day->date -1 0)
$2 = #<date nanosecond: 0 second: 0 minute: 0 hour: -12 day: 24 month: 11 year: -4714 zone-offset: 0>
scheme@(guile-user)> (julian-day->date -100000 0)
$3 = #<date nanosecond: 0 second: 0 minute: 0 hour: -12 day: -19 month: 3 year: -4987 zone-offset: 0>
scheme@(guile-user)> (julian-day->date -10000000 0)
$4 = #<date nanosecond: 0 second: 0 minute: 0 hour: -12 day: -30 month: 0 year: -32092 zone-offset: 0>

Observe the various erroneous field values: negative hour, negative
day-of-month, zero month.  These occur in general for various negative
JD inputs.  Not only should the conversion not produce these kinds of
values, the date structure type probably ought to reject them if they
get that far.

-zefram





             reply	other threads:[~2015-11-13 14:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-13 14:31 Zefram [this message]
2018-10-21  3:20 ` bug#21906: julian-day->date negative input breakage Mark H Weaver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151113143104.GP13455@fysh.org \
    --to=zefram@fysh.org \
    --cc=21906@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).