Litipk\BigNumbers\DecimalConstants::lightSpeed PHP Method

lightSpeed() public static method

Returns the Light of Speed measured in meters / second.
public static lightSpeed ( ) : Decimal
return Decimal
    public static function lightSpeed()
    {
        if (self::$LightSpeed === null) {
            self::$LightSpeed = Decimal::fromInteger(299792458);
        }
        return self::$LightSpeed;
    }

Usage Example

 public function testFiniteAbs()
 {
     $this->assertTrue(DecimalConstants::pi()->equals(Decimal::fromString("3.14159265358979323846264338327950")));
     $this->assertTrue(DecimalConstants::eulerMascheroni()->equals(Decimal::fromString("0.57721566490153286060651209008240")));
     $this->assertTrue(DecimalConstants::goldenRatio()->equals(Decimal::fromString("1.61803398874989484820458683436564")));
     $this->assertTrue(DecimalConstants::lightSpeed()->equals(Decimal::fromInteger(299792458)));
 }