Article View: comp.lang.prolog
Article #1066Re: Calculating ages
From: Richard A. O'Keefe
Date: Sun, 19 Aug 1990 23:09
Date: Sun, 19 Aug 1990 23:09
17 lines
1292 bytes
1292 bytes
In article <982@christopher-robin.cs.bham.ac.uk>, cjr@cs.bham.ac.uk (Chris Ridd <RiddCJ>) writes: > Does anyone know how to calculate a person's age in Prolog (well, any > language will do)? We are given today's date and their birthday, and > need the answer in years, weeks and days. Look in the book Numerical Recipes, specifically at JULDAT. Or, if you have Quintus Prolog, use library(date). By the way, the answer in "years, weeks, and days" is not well defined. Presumably you mean "subtract the birth date from the last birthday, taking that as _calendar_ years, and take weeks and days since the last birthday". With that definition (completed years + time since last birthday) you only need to worry about whether the current and previous years were leap years. -- The taxonomy of Pleistocene equids is in a state of confusion.
Technical Details
Message-ID:
<3583@goanna.cs.rmit.oz.au>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!munnari.oz.au!goanna!okReferences:
<982@christopher-robin.cs.bham.ac.uk>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!munnari.oz.au!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.prolog,comp.lang.misc Subject: Re: Calculating ages Message-ID: <3583@goanna.cs.rmit.oz.au> Date: 19 Aug 90 23:09:33 GMT References: <982@christopher-robin.cs.bham.ac.uk> Followup-To: comp.lang.prolog Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 17