4
* Copyright 2017 DataStax, Inc.
6
* Licensed under the Apache License, Version 2.0 (the "License");
7
* you may not use this file except in compliance with the License.
8
* You may obtain a copy of the License at
10
* http://www.apache.org/licenses/LICENSE-2.0
12
* Unless required by applicable law or agreed to in writing, software
13
* distributed under the License is distributed on an "AS IS" BASIS,
14
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
* See the License for the specific language governing permissions and
16
* limitations under the License.
22
* A PHP representation of the CQL `smallint` datatype.
24
final class Smallint implements Value, Numeric {
27
* Creates a new 16-bit signed integer.
29
* @param int|double|string $value The value as an integer, double or string
31
public function __construct($value) { }
36
public function __toString() { }
39
* The type of this value (smallint).
43
public function type() { }
46
* Returns the integer value.
48
* @return int integer value
50
public function value() { }
53
* @param Numeric $num a number to add to this one
56
public function add($num) { }
59
* @param Numeric $num a number to subtract from this one
60
* @return Numeric difference
62
public function sub($num) { }
65
* @param Numeric $num a number to multiply this one by
66
* @return Numeric product
68
public function mul($num) { }
71
* @param Numeric $num a number to divide this one by
72
* @return Numeric quotient
74
public function div($num) { }
77
* @param Numeric $num a number to divide this one by
78
* @return Numeric remainder
80
public function mod($num) { }
83
* @return Numeric absolute value
85
public function abs() { }
88
* @return Numeric negative value
90
public function neg() { }
93
* @return Numeric square root
95
public function sqrt() { }
98
* @return int this number as int
100
public function toInt() { }
103
* @return float this number as float
105
public function toDouble() { }
108
* Minimum possible Smallint value
110
* @return Smallint minimum value
112
public static function min() { }
115
* Maximum possible Smallint value
117
* @return Smallint maximum value
119
public static function max() { }