unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#21906: julian-day->date negative input breakage
@ 2015-11-13 14:31 Zefram
  2018-10-21  3:20 ` Mark H Weaver
  0 siblings, 1 reply; 2+ messages in thread
From: Zefram @ 2015-11-13 14:31 UTC (permalink / raw)
  To: 21906

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





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#21906: julian-day->date negative input breakage
  2015-11-13 14:31 bug#21906: julian-day->date negative input breakage Zefram
@ 2018-10-21  3:20 ` Mark H Weaver
  0 siblings, 0 replies; 2+ messages in thread
From: Mark H Weaver @ 2018-10-21  3:20 UTC (permalink / raw)
  To: Zefram; +Cc: 21906-done

Zefram <zefram@fysh.org> writes:

> 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>

This is fixed by commit a58c7abd72648f77e4ede5f62a2c4e7969bb7f95 on the
stable-2.2 branch.  I'm closing this bug, but please reopen if
appropriate.

     Thanks!
       Mark





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-21  3:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-13 14:31 bug#21906: julian-day->date negative input breakage Zefram
2018-10-21  3:20 ` Mark H Weaver

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).