当前位置: 首页>>代码示例>>PHP>>正文


PHP AgaviToolkit::floorDivide方法代码示例

本文整理汇总了PHP中AgaviToolkit::floorDivide方法的典型用法代码示例。如果您正苦于以下问题:PHP AgaviToolkit::floorDivide方法的具体用法?PHP AgaviToolkit::floorDivide怎么用?PHP AgaviToolkit::floorDivide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AgaviToolkit的用法示例。


在下文中一共展示了AgaviToolkit::floorDivide方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getOffsetRef

 /**
  * AgaviTimeZone API.
  *
  * @see        AgaviTimeZone::getOffsetRef()
  * 
  * @author     Dominik del Bondio <ddb@bitxtender.com>
  * @author     The ICU Project
  * @since      0.11.0
  */
 public function getOffsetRef($date, $local, &$rawoff, &$dstoff)
 {
     // The check against finalMillis will suffice most of the time, except
     // for the case in which finalMillis == DBL_MAX, date == DBL_MAX,
     // and finalZone == 0.  For this case we add "&& finalZone != 0".
     if ($date >= $this->finalMillis && $this->finalZone !== null) {
         $millis = 0;
         $days = AgaviToolkit::floorDivide($date, AgaviDateDefinitions::MILLIS_PER_DAY, $millis);
         $year = 0;
         $month = 0;
         $dom = 0;
         $dow = 0;
         AgaviCalendarGrego::dayToFields($days, $year, $month, $dom, $dow);
         $rawoff = $this->finalZone->getRawOffset();
         if (!$local) {
             // Adjust from GMT to local
             $date += $rawoff;
             $days2 = AgaviToolkit::floorDivide($date, AgaviDateDefinitions::MILLIS_PER_DAY, $millis);
             if ($days2 != $days) {
                 AgaviCalendarGrego::dayToFields($days2, $year, $month, $dom, $dow);
             }
         }
         $dstoff = $this->finalZone->getOffset(AgaviGregorianCalendar::AD, $year, $month, $dom, $dow, $millis) - $rawoff;
         return;
     }
     $secs = floor($date / AgaviDateDefinitions::MILLIS_PER_SECOND);
     $transition = $this->findTransition($secs, $local);
     $rawoff = $this->types[$transition['type']]['rawOffset'] * AgaviDateDefinitions::MILLIS_PER_SECOND;
     $dstoff = $this->types[$transition['type']]['dstOffset'] * AgaviDateDefinitions::MILLIS_PER_SECOND;
 }
开发者ID:horros,项目名称:agavi,代码行数:39,代码来源:AgaviOlsonTimeZone.class.php

示例2: handleGetMonthLength

 /**
  * @see        AgaviCalendar::handleGetMonthLength
  * 
  * @author     Dominik del Bondio <ddb@bitxtender.com>
  * @author     The ICU Project
  * @since      0.11.0
  */
 protected function handleGetMonthLength($extendedYear, $month)
 {
     // If the month is out of range, adjust it into range, and
     // modify the extended year value accordingly.
     if ($month < 0 || $month > 11) {
         $extendedYear += AgaviToolkit::floorDivide($month, 12, $month);
     }
     return $this->isLeapYear($extendedYear) ? self::$kLeapMonthLength[$month] : self::$kMonthLength[$month];
 }
开发者ID:horros,项目名称:agavi,代码行数:16,代码来源:AgaviGregorianCalendar.class.php

示例3: dayOfWeek

 /**
  * Return the day of week on the 1970-epoch day
  * 
  * @param      float  day the 1970-epoch day (integral value)
  * 
  * @return     int    the day of week
  * 
  * @author     Dominik del Bondio <dominik.del.bondio@bitextender.com>
  * @author     The ICU Project
  * @since      1.0.1
  */
 public static function dayOfWeek($day)
 {
     $dow = null;
     AgaviToolkit::floorDivide($day + AgaviDateDefinitions::THURSDAY, 7, $dow);
     return $dow == 0 ? AgaviDateDefinitions::SATURDAY : $dow;
 }
开发者ID:philippjenni,项目名称:icinga-web,代码行数:17,代码来源:AgaviCalendarGrego.class.php

示例4: testFloorDivideByZero

 /**
  * @expectedException PHPUnit_Framework_Error
  */
 public function testFloorDivideByZero()
 {
     AgaviToolkit::floorDivide(10, 0, $rem);
 }
开发者ID:horros,项目名称:agavi,代码行数:7,代码来源:AgaviToolkitTest.php


注:本文中的AgaviToolkit::floorDivide方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。