|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-09-21 08:33 UTC] momo@php.net
[2005-03-06 20:48 UTC] sniper@php.net
[2005-03-18 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 03:00:02 2025 UTC |
Description: ------------ Good morning, Re. php-5.0.0 I noticed in sunfuncs.c/php_sunrise_sunset() there's this commented out snippet: /* XXX: What's the use of this block.. ? * if (!calc_sunset && cosH > 1 || calc_sunset && cosH < -1) { * throw doesnthappen(); * } */ What the 'if' clause actually would detect is cases where you have no sunrise or sunset, i.e. during the midnight sun period, on the Northern hemisphere around June 21st, above ca. 66.5 deg latitude. For instance, try: php_sunrise_sunset( 182, 66, 0, 90.83, 0 ); this should give a good value for sunrise, very early in the morning. Now try php_sunrise_sunset( 182, 67, 0, 90.83, 0 ); this should give NaN. The reason is obvious: above ca. 66.56 deg latitude in the summer (here day 182) you have the midnight sun period: the sun doesn't set and/or rise. However, this function isn't used anywhere -- is it? --bjd bjdouma@xs4all.nl