Skip to content

Navigation Menu

Sign inAppearance settings
Appearance settings

Latest commit

 

History

History
History
394 lines (365 loc) · 16.6 KB

File metadata and controls

394 lines (365 loc) · 16.6 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
/*
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// Auto-generated file. DO NOT EDIT!
package kotlin
import kotlin.experimental.*
import kotlin.jvm.*
@SinceKotlin("1.5")
@WasExperimental(ExperimentalUnsignedTypes::class)
@JvmInline
public value class UShort @PublishedApi internal constructor(@PublishedApi internal val data: Short) : Comparable<UShort> {
companion object {
/**
* A constant holding the minimum value an instance of UShort can have.
*/
public const val MIN_VALUE: UShort = UShort(0)
/**
* A constant holding the maximum value an instance of UShort can have.
*/
public const val MAX_VALUE: UShort = UShort(-1)
/**
* The number of bytes used to represent an instance of UShort in a binary form.
*/
public const val SIZE_BYTES: Int = 2
/**
* The number of bits used to represent an instance of UShort in a binary form.
*/
public const val SIZE_BITS: Int = 16
}
/**
* Compares this value with the specified value for order.
* Returns zero if this value is equal to the specified other value, a negative number if it's less than other,
* or a positive number if it's greater than other.
*/
@kotlin.internal.InlineOnly
public inline operator fun compareTo(other: UByte): Int = this.toInt().compareTo(other.toInt())
/**
* Compares this value with the specified value for order.
* Returns zero if this value is equal to the specified other value, a negative number if it's less than other,
* or a positive number if it's greater than other.
*/
@kotlin.internal.InlineOnly
@Suppress("OVERRIDE_BY_INLINE")
public override inline operator fun compareTo(other: UShort): Int = this.toInt().compareTo(other.toInt())
/**
* Compares this value with the specified value for order.
* Returns zero if this value is equal to the specified other value, a negative number if it's less than other,
* or a positive number if it's greater than other.
*/
@kotlin.internal.InlineOnly
public inline operator fun compareTo(other: UInt): Int = this.toUInt().compareTo(other)
/**
* Compares this value with the specified value for order.
* Returns zero if this value is equal to the specified other value, a negative number if it's less than other,
* or a positive number if it's greater than other.
*/
@kotlin.internal.InlineOnly
public inline operator fun compareTo(other: ULong): Int = this.toULong().compareTo(other)
/** Adds the other value to this value. */
@kotlin.internal.InlineOnly
public inline operator fun plus(other: UByte): UInt = this.toUInt().plus(other.toUInt())
/** Adds the other value to this value. */
@kotlin.internal.InlineOnly
public inline operator fun plus(other: UShort): UInt = this.toUInt().plus(other.toUInt())
/** Adds the other value to this value. */
@kotlin.internal.InlineOnly
public inline operator fun plus(other: UInt): UInt = this.toUInt().plus(other)
/** Adds the other value to this value. */
@kotlin.internal.InlineOnly
public inline operator fun plus(other: ULong): ULong = this.toULong().plus(other)
/** Subtracts the other value from this value. */
@kotlin.internal.InlineOnly
public inline operator fun minus(other: UByte): UInt = this.toUInt().minus(other.toUInt())
/** Subtracts the other value from this value. */
@kotlin.internal.InlineOnly
public inline operator fun minus(other: UShort): UInt = this.toUInt().minus(other.toUInt())
/** Subtracts the other value from this value. */
@kotlin.internal.InlineOnly
public inline operator fun minus(other: UInt): UInt = this.toUInt().minus(other)
/** Subtracts the other value from this value. */
@kotlin.internal.InlineOnly
public inline operator fun minus(other: ULong): ULong = this.toULong().minus(other)
/** Multiplies this value by the other value. */
@kotlin.internal.InlineOnly
public inline operator fun times(other: UByte): UInt = this.toUInt().times(other.toUInt())
/** Multiplies this value by the other value. */
@kotlin.internal.InlineOnly
public inline operator fun times(other: UShort): UInt = this.toUInt().times(other.toUInt())
/** Multiplies this value by the other value. */
@kotlin.internal.InlineOnly
public inline operator fun times(other: UInt): UInt = this.toUInt().times(other)
/** Multiplies this value by the other value. */
@kotlin.internal.InlineOnly
public inline operator fun times(other: ULong): ULong = this.toULong().times(other)
/** Divides this value by the other value, truncating the result to an integer that is closer to zero. */
@kotlin.internal.InlineOnly
public inline operator fun div(other: UByte): UInt = this.toUInt().div(other.toUInt())
/** Divides this value by the other value, truncating the result to an integer that is closer to zero. */
@kotlin.internal.InlineOnly
public inline operator fun div(other: UShort): UInt = this.toUInt().div(other.toUInt())
/** Divides this value by the other value, truncating the result to an integer that is closer to zero. */
@kotlin.internal.InlineOnly
public inline operator fun div(other: UInt): UInt = this.toUInt().div(other)
/** Divides this value by the other value, truncating the result to an integer that is closer to zero. */
@kotlin.internal.InlineOnly
public inline operator fun div(other: ULong): ULong = this.toULong().div(other)
/**
* Calculates the remainder of truncating division of this value by the other value.
*
* The result is always less than the divisor.
*/
@kotlin.internal.InlineOnly
public inline operator fun rem(other: UByte): UInt = this.toUInt().rem(other.toUInt())
/**
* Calculates the remainder of truncating division of this value by the other value.
*
* The result is always less than the divisor.
*/
@kotlin.internal.InlineOnly
public inline operator fun rem(other: UShort): UInt = this.toUInt().rem(other.toUInt())
/**
* Calculates the remainder of truncating division of this value by the other value.
*
* The result is always less than the divisor.
*/
@kotlin.internal.InlineOnly
public inline operator fun rem(other: UInt): UInt = this.toUInt().rem(other)
/**
* Calculates the remainder of truncating division of this value by the other value.
*
* The result is always less than the divisor.
*/
@kotlin.internal.InlineOnly
public inline operator fun rem(other: ULong): ULong = this.toULong().rem(other)
/**
* Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.
*
* For unsigned types, the results of flooring division and truncating division are the same.
*/
@kotlin.internal.InlineOnly
public inline fun floorDiv(other: UByte): UInt = this.toUInt().floorDiv(other.toUInt())
/**
* Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.
*
* For unsigned types, the results of flooring division and truncating division are the same.
*/
@kotlin.internal.InlineOnly
public inline fun floorDiv(other: UShort): UInt = this.toUInt().floorDiv(other.toUInt())
/**
* Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.
*
* For unsigned types, the results of flooring division and truncating division are the same.
*/
@kotlin.internal.InlineOnly
public inline fun floorDiv(other: UInt): UInt = this.toUInt().floorDiv(other)
/**
* Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.
*
* For unsigned types, the results of flooring division and truncating division are the same.
*/
@kotlin.internal.InlineOnly
public inline fun floorDiv(other: ULong): ULong = this.toULong().floorDiv(other)
/**
* Calculates the remainder of flooring division of this value by the other value.
*
* The result is always less than the divisor.
*
* For unsigned types, the remainders of flooring division and truncating division are the same.
*/
@kotlin.internal.InlineOnly
public inline fun mod(other: UByte): UByte = this.toUInt().mod(other.toUInt()).toUByte()
/**
* Calculates the remainder of flooring division of this value by the other value.
*
* The result is always less than the divisor.
*
* For unsigned types, the remainders of flooring division and truncating division are the same.
*/
@kotlin.internal.InlineOnly
public inline fun mod(other: UShort): UShort = this.toUInt().mod(other.toUInt()).toUShort()
/**
* Calculates the remainder of flooring division of this value by the other value.
*
* The result is always less than the divisor.
*
* For unsigned types, the remainders of flooring division and truncating division are the same.
*/
@kotlin.internal.InlineOnly
public inline fun mod(other: UInt): UInt = this.toUInt().mod(other)
/**
* Calculates the remainder of flooring division of this value by the other value.
*
* The result is always less than the divisor.
*
* For unsigned types, the remainders of flooring division and truncating division are the same.
*/
@kotlin.internal.InlineOnly
public inline fun mod(other: ULong): ULong = this.toULong().mod(other)
/**
* Returns this value incremented by one.
*
* @sample samples.misc.Builtins.inc
*/
@kotlin.internal.InlineOnly
public inline operator fun inc(): UShort = UShort(data.inc())
/**
* Returns this value decremented by one.
*
* @sample samples.misc.Builtins.dec
*/
@kotlin.internal.InlineOnly
public inline operator fun dec(): UShort = UShort(data.dec())
/** Creates a range from this value to the specified [other] value. */
@kotlin.internal.InlineOnly
public inline operator fun rangeTo(other: UShort): UIntRange = UIntRange(this.toUInt(), other.toUInt())
/** Performs a bitwise AND operation between the two values. */
@kotlin.internal.InlineOnly
public inline infix fun and(other: UShort): UShort = UShort(this.data and other.data)
/** Performs a bitwise OR operation between the two values. */
@kotlin.internal.InlineOnly
public inline infix fun or(other: UShort): UShort = UShort(this.data or other.data)
/** Performs a bitwise XOR operation between the two values. */
@kotlin.internal.InlineOnly
public inline infix fun xor(other: UShort): UShort = UShort(this.data xor other.data)
/** Inverts the bits in this value. */
@kotlin.internal.InlineOnly
public inline fun inv(): UShort = UShort(data.inv())
/**
* Converts this [UShort] value to [Byte].
*
* If this value is less than or equals to [Byte.MAX_VALUE], the resulting `Byte` value represents
* the same numerical value as this `UShort`.
*
* The resulting `Byte` value is represented by the least significant 8 bits of this `UShort` value.
* Note that the resulting `Byte` value may be negative.
*/
@kotlin.internal.InlineOnly
public inline fun toByte(): Byte = data.toByte()
/**
* Converts this [UShort] value to [Short].
*
* If this value is less than or equals to [Short.MAX_VALUE], the resulting `Short` value represents
* the same numerical value as this `UShort`. Otherwise the result is negative.
*
* The resulting `Short` value has the same binary representation as this `UShort` value.
*/
@kotlin.internal.InlineOnly
public inline fun toShort(): Short = data
/**
* Converts this [UShort] value to [Int].
*
* The resulting `Int` value represents the same numerical value as this `UShort`.
*
* The least significant 16 bits of the resulting `Int` value are the same as the bits of this `UShort` value,
* whereas the most significant 16 bits are filled with zeros.
*/
@kotlin.internal.InlineOnly
public inline fun toInt(): Int = data.toInt() and 0xFFFF
/**
* Converts this [UShort] value to [Long].
*
* The resulting `Long` value represents the same numerical value as this `UShort`.
*
* The least significant 16 bits of the resulting `Long` value are the same as the bits of this `UShort` value,
* whereas the most significant 48 bits are filled with zeros.
*/
@kotlin.internal.InlineOnly
public inline fun toLong(): Long = data.toLong() and 0xFFFF
/**
* Converts this [UShort] value to [UByte].
*
* If this value is less than or equals to [UByte.MAX_VALUE], the resulting `UByte` value represents
* the same numerical value as this `UShort`.
*
* The resulting `UByte` value is represented by the least significant 8 bits of this `UShort` value.
*/
@kotlin.internal.InlineOnly
public inline fun toUByte(): UByte = data.toUByte()
/** Returns this value. */
@kotlin.internal.InlineOnly
public inline fun toUShort(): UShort = this
/**
* Converts this [UShort] value to [UInt].
*
* The resulting `UInt` value represents the same numerical value as this `UShort`.
*
* The least significant 16 bits of the resulting `UInt` value are the same as the bits of this `UShort` value,
* whereas the most significant 16 bits are filled with zeros.
*/
@kotlin.internal.InlineOnly
public inline fun toUInt(): UInt = UInt(data.toInt() and 0xFFFF)
/**
* Converts this [UShort] value to [ULong].
*
* The resulting `ULong` value represents the same numerical value as this `UShort`.
*
* The least significant 16 bits of the resulting `ULong` value are the same as the bits of this `UShort` value,
* whereas the most significant 48 bits are filled with zeros.
*/
@kotlin.internal.InlineOnly
public inline fun toULong(): ULong = ULong(data.toLong() and 0xFFFF)
/**
* Converts this [UShort] value to [Float].
*
* The resulting `Float` value represents the same numerical value as this `UShort`.
*/
@kotlin.internal.InlineOnly
public inline fun toFloat(): Float = this.toInt().toFloat()
/**
* Converts this [UShort] value to [Double].
*
* The resulting `Double` value represents the same numerical value as this `UShort`.
*/
@kotlin.internal.InlineOnly
public inline fun toDouble(): Double = this.toInt().toDouble()
public override fun toString(): String = toInt().toString()
}
/**
* Converts this [Byte] value to [UShort].
*
* If this value is positive, the resulting `UShort` value represents the same numerical value as this `Byte`.
*
* The least significant 8 bits of the resulting `UShort` value are the same as the bits of this `Byte` value,
* whereas the most significant 8 bits are filled with the sign bit of this value.
*/
@SinceKotlin("1.5")
@WasExperimental(ExperimentalUnsignedTypes::class)
@kotlin.internal.InlineOnly
public inline fun Byte.toUShort(): UShort = UShort(this.toShort())
/**
* Converts this [Short] value to [UShort].
*
* If this value is positive, the resulting `UShort` value represents the same numerical value as this `Short`.
*
* The resulting `UShort` value has the same binary representation as this `Short` value.
*/
@SinceKotlin("1.5")
@WasExperimental(ExperimentalUnsignedTypes::class)
@kotlin.internal.InlineOnly
public inline fun Short.toUShort(): UShort = UShort(this)
/**
* Converts this [Int] value to [UShort].
*
* If this value is positive and less than or equals to [UShort.MAX_VALUE], the resulting `UShort` value represents
* the same numerical value as this `Int`.
*
* The resulting `UShort` value is represented by the least significant 16 bits of this `Int` value.
*/
@SinceKotlin("1.5")
@WasExperimental(ExperimentalUnsignedTypes::class)
@kotlin.internal.InlineOnly
public inline fun Int.toUShort(): UShort = UShort(this.toShort())
/**
* Converts this [Long] value to [UShort].
*
* If this value is positive and less than or equals to [UShort.MAX_VALUE], the resulting `UShort` value represents
* the same numerical value as this `Long`.
*
* The resulting `UShort` value is represented by the least significant 16 bits of this `Long` value.
*/
@SinceKotlin("1.5")
@WasExperimental(ExperimentalUnsignedTypes::class)
@kotlin.internal.InlineOnly
public inline fun Long.toUShort(): UShort = UShort(this.toShort())
Morty Proxy This is a proxified and sanitized view of the page, visit original site.