-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Base.jl
2481 lines (1874 loc) · 54.7 KB
/
Base.jl
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
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# This file is a part of Julia. License is MIT: https://julialang.org/license
# Base
"""
fill!(A, x)
Fill array `A` with the value `x`. If `x` is an object reference, all elements will refer to
the same object. `fill!(A, Foo())` will return `A` filled with the result of evaluating
`Foo()` once.
```jldoctest
julia> A = zeros(2,3)
2×3 Array{Float64,2}:
0.0 0.0 0.0
0.0 0.0 0.0
julia> fill!(A, 2.)
2×3 Array{Float64,2}:
2.0 2.0 2.0
2.0 2.0 2.0
julia> a = [1, 1, 1]; A = fill!(Vector{Vector{Int}}(3), a); a[1] = 2; A
3-element Array{Array{Int64,1},1}:
[2, 1, 1]
[2, 1, 1]
[2, 1, 1]
julia> x = 0; f() = (global x += 1; x); fill!(Vector{Int}(3), f())
3-element Array{Int64,1}:
1
1
1
```
"""
fill!
"""
read!(stream::IO, array::Union{Array, BitArray})
read!(filename::AbstractString, array::Union{Array, BitArray})
Read binary data from an I/O stream or file, filling in `array`.
"""
read!
"""
pointer(array [, index])
Get the native address of an array or string element. Be careful to ensure that a Julia
reference to `a` exists as long as this pointer will be used. This function is "unsafe" like
`unsafe_convert`.
Calling `Ref(array[, index])` is generally preferable to this function.
"""
pointer
"""
precision(num::AbstractFloat)
Get the precision of a floating point number, as defined by the effective number of bits in
the mantissa.
"""
precision
"""
-(x)
Unary minus operator.
"""
-(x)
"""
-(x, y)
Subtraction operator.
"""
-(x, y)
"""
bits(n)
A string giving the literal bit representation of a number.
```jldoctest
julia> bits(4)
"0000000000000000000000000000000000000000000000000000000000000100"
julia> bits(2.2)
"0100000000000001100110011001100110011001100110011001100110011010"
```
"""
bits
"""
getindex(type[, elements...])
Construct a 1-d array of the specified type. This is usually called with the syntax
`Type[]`. Element values can be specified using `Type[a,b,c,...]`.
```jldoctest
julia> Int8[1, 2, 3]
3-element Array{Int8,1}:
1
2
3
julia> getindex(Int8, 1, 2, 3)
3-element Array{Int8,1}:
1
2
3
```
"""
getindex(::Type, elements...)
"""
getindex(A, inds...)
Returns a subset of array `A` as specified by `inds`, where each `ind` may be an
`Int`, a `Range`, or a `Vector`. See the manual section on
[array indexing](@ref man-array-indexing) for details.
```jldoctest
julia> A = [1 2; 3 4]
2×2 Array{Int64,2}:
1 2
3 4
julia> getindex(A, 1)
1
julia> getindex(A, [2, 1])
2-element Array{Int64,1}:
3
1
julia> getindex(A, 2:4)
3-element Array{Int64,1}:
3
2
4
```
"""
getindex(::AbstractArray, inds...)
"""
getindex(collection, key...)
Retrieve the value(s) stored at the given key or index within a collection. The syntax
`a[i,j,...]` is converted by the compiler to `getindex(a, i, j, ...)`.
```jldoctest
julia> A = Dict("a" => 1, "b" => 2)
Dict{String,Int64} with 2 entries:
"b" => 2
"a" => 1
julia> getindex(A, "a")
1
```
"""
getindex(collection, key...)
"""
cconvert(T,x)
Convert `x` to a value of type `T`, typically by calling `convert(T,x)`
In cases where `x` cannot be safely converted to `T`, unlike [`convert`](@ref), `cconvert` may
return an object of a type different from `T`, which however is suitable for
[`unsafe_convert`](@ref) to handle.
Neither `convert` nor `cconvert` should take a Julia object and turn it into a `Ptr`.
"""
cconvert
"""
assert(cond)
Throw an [`AssertionError`](@ref) if `cond` is `false`.
Also available as the macro `@assert expr`.
"""
assert
"""
sech(x)
Compute the hyperbolic secant of `x`
"""
sech
"""
unsafe_copy!(dest::Ptr{T}, src::Ptr{T}, N)
Copy `N` elements from a source pointer to a destination, with no checking. The size of an
element is determined by the type of the pointers.
The `unsafe` prefix on this function indicates that no validation is performed on the
pointers `dest` and `src` to ensure that they are valid. Incorrect usage may corrupt or
segfault your program, in the same manner as C.
"""
unsafe_copy!{T}(dest::Ptr{T}, src::Ptr{T}, N)
"""
unsafe_copy!(dest::Array, do, src::Array, so, N)
Copy `N` elements from a source array to a destination, starting at offset `so` in the
source and `do` in the destination (1-indexed).
The `unsafe` prefix on this function indicates that no validation is performed to ensure
that N is inbounds on either array. Incorrect usage may corrupt or segfault your program, in
the same manner as C.
"""
unsafe_copy!(dest::Array, d, src::Array, so, N)
"""
Float32(x [, mode::RoundingMode])
Create a Float32 from `x`. If `x` is not exactly representable then `mode` determines how
`x` is rounded.
```jldoctest
julia> Float32(1/3, RoundDown)
0.3333333f0
julia> Float32(1/3, RoundUp)
0.33333334f0
```
See [`RoundingMode`](@ref) for available rounding modes.
"""
Float32(x)
"""
Mmap.mmap(io::Union{IOStream,AbstractString,Mmap.AnonymousMmap}[, type::Type{Array{T,N}}, dims, offset]; grow::Bool=true, shared::Bool=true)
Mmap.mmap(type::Type{Array{T,N}}, dims)
Create an `Array` whose values are linked to a file, using memory-mapping. This provides a
convenient way of working with data too large to fit in the computer's memory.
The type is an `Array{T,N}` with a bits-type element of `T` and dimension `N` that
determines how the bytes of the array are interpreted. Note that the file must be stored in
binary format, and no format conversions are possible (this is a limitation of operating
systems, not Julia).
`dims` is a tuple or single [`Integer`](@ref) specifying the size or length of the array.
The file is passed via the stream argument, either as an open `IOStream` or filename string.
When you initialize the stream, use `"r"` for a "read-only" array, and `"w+"` to create a
new array used to write values to disk.
If no `type` argument is specified, the default is `Vector{UInt8}`.
Optionally, you can specify an offset (in bytes) if, for example, you want to skip over a
header in the file. The default value for the offset is the current stream position for an
`IOStream`.
The `grow` keyword argument specifies whether the disk file should be grown to accommodate
the requested size of array (if the total file size is < requested array size). Write
privileges are required to grow the file.
The `shared` keyword argument specifies whether the resulting `Array` and changes made to it
will be visible to other processes mapping the same file.
For example, the following code
```julia
# Create a file for mmapping
# (you could alternatively use mmap to do this step, too)
A = rand(1:20, 5, 30)
s = open("/tmp/mmap.bin", "w+")
# We'll write the dimensions of the array as the first two Ints in the file
write(s, size(A,1))
write(s, size(A,2))
# Now write the data
write(s, A)
close(s)
# Test by reading it back in
s = open("/tmp/mmap.bin") # default is read-only
m = read(s, Int)
n = read(s, Int)
A2 = Mmap.mmap(s, Matrix{Int}, (m,n))
```
creates a `m`-by-`n` `Matrix{Int}`, linked to the file associated with stream `s`.
A more portable file would need to encode the word size -- 32 bit or 64 bit -- and endianness
information in the header. In practice, consider encoding binary data using standard formats
like HDF5 (which can be used with memory-mapping).
"""
Mmap.mmap(io, ::Type, dims, offset)
"""
Mmap.mmap(io, BitArray, [dims, offset])
Create a `BitArray` whose values are linked to a file, using memory-mapping; it has the same
purpose, works in the same way, and has the same arguments, as [`mmap`](@ref Mmap.mmap), but
the byte representation is different.
**Example**: `B = Mmap.mmap(s, BitArray, (25,30000))`
This would create a 25-by-30000 `BitArray`, linked to the file associated with stream `s`.
"""
Mmap.mmap(io, ::BitArray, dims = ?, offset = ?)
"""
filter!(function, collection)
Update `collection`, removing elements for which `function` is `false`.
For associative collections, the function is passed two arguments (key and value).
```jldoctest
julia> filter!(isodd, collect(1:10))
5-element Array{Int64,1}:
1
3
5
7
9
```
"""
filter!
"""
sizeof(T)
Size, in bytes, of the canonical binary representation of the given DataType `T`, if any.
```jldoctest
julia> sizeof(Float32)
4
julia> sizeof(Complex128)
16
```
If `T` does not have a specific size, an error is thrown.
```jldoctest
julia> sizeof(Base.LinAlg.LU)
ERROR: argument is an abstract type; size is indeterminate
Stacktrace:
[1] sizeof(::Type{T} where T) at ./essentials.jl:160
```
"""
sizeof(::Type)
"""
ReadOnlyMemoryError()
An operation tried to write to memory that is read-only.
"""
ReadOnlyMemoryError
"""
ceil([T,] x, [digits, [base]])
`ceil(x)` returns the nearest integral value of the same type as `x` that is greater than or
equal to `x`.
`ceil(T, x)` converts the result to type `T`, throwing an `InexactError` if the value is not
representable.
`digits` and `base` work as for [`round`](@ref).
"""
ceil
"""
oftype(x, y)
Convert `y` to the type of `x` (`convert(typeof(x), y)`).
"""
oftype
"""
push!(collection, items...) -> collection
Insert one or more `items` at the end of `collection`.
```jldoctest
julia> push!([1, 2, 3], 4, 5, 6)
6-element Array{Int64,1}:
1
2
3
4
5
6
```
Use [`append!`](@ref) to add all the elements of another collection to
`collection`. The result of the preceding example is equivalent to `append!([1, 2, 3], [4,
5, 6])`.
"""
push!
"""
promote(xs...)
Convert all arguments to their common promotion type (if any), and return them all (as a tuple).
"""
promote
"""
fd(stream)
Returns the file descriptor backing the stream or file. Note that this function only applies
to synchronous `File`'s and `IOStream`'s not to any of the asynchronous streams.
"""
fd
"""
ones([A::AbstractArray,] [T=eltype(A)::Type,] [dims=size(A)::Tuple])
Create an array of all ones with the same layout as `A`, element type `T` and size `dims`.
The `A` argument can be skipped, which behaves like `Array{Float64,0}()` was passed.
For convenience `dims` may also be passed in variadic form.
```jldoctest
julia> ones(Complex128, 2, 3)
2×3 Array{Complex{Float64},2}:
1.0+0.0im 1.0+0.0im 1.0+0.0im
1.0+0.0im 1.0+0.0im 1.0+0.0im
julia> ones(1,2)
1×2 Array{Float64,2}:
1.0 1.0
julia> A = [1 2; 3 4]
2×2 Array{Int64,2}:
1 2
3 4
julia> ones(A)
2×2 Array{Int64,2}:
1 1
1 1
julia> ones(A, Float64)
2×2 Array{Float64,2}:
1.0 1.0
1.0 1.0
julia> ones(A, Bool, (3,))
3-element Array{Bool,1}:
true
true
true
```
See also [`zeros`](@ref), [`similar`](@ref).
"""
ones
"""
randsubseq!(S, A, p)
Like [`randsubseq`](@ref), but the results are stored in `S`
(which is resized as needed).
"""
randsubseq!
"""
redisplay(x)
redisplay(d::Display, x)
redisplay(mime, x)
redisplay(d::Display, mime, x)
By default, the `redisplay` functions simply call [`display`](@ref).
However, some display backends may override `redisplay` to modify an existing
display of `x` (if any).
Using `redisplay` is also a hint to the backend that `x` may be redisplayed
several times, and the backend may choose to defer the display until
(for example) the next interactive prompt.
"""
redisplay
"""
searchsorted(a, x, [by=<transform>,] [lt=<comparison>,] [rev=false])
Returns the range of indices of `a` which compare as equal to `x` (using binary search)
according to the order specified by the `by`, `lt` and `rev` keywords, assuming that `a`
is already sorted in that order. Returns an empty range located at the insertion point
if `a` does not contain values equal to `x`.
"""
searchsorted
"""
/(x, y)
Right division operator: multiplication of `x` by the inverse of `y` on the right. Gives
floating-point results for integer arguments.
"""
Base.:(/)
"""
dump(x)
Show every part of the representation of a value.
"""
dump
"""
isinteractive() -> Bool
Determine whether Julia is running an interactive session.
"""
isinteractive
"""
display(x)
display(d::Display, x)
display(mime, x)
display(d::Display, mime, x)
Display `x` using the topmost applicable display in the display stack, typically using the
richest supported multimedia output for `x`, with plain-text [`STDOUT`](@ref) output as a fallback.
The `display(d, x)` variant attempts to display `x` on the given display `d` only, throwing
a `MethodError` if `d` cannot display objects of this type.
There are also two variants with a `mime` argument (a MIME type string, such as
`"image/png"`), which attempt to display `x` using the requested MIME type *only*, throwing
a `MethodError` if this type is not supported by either the display(s) or by `x`. With these
variants, one can also supply the "raw" data in the requested MIME type by passing
`x::AbstractString` (for MIME types with text-based storage, such as text/html or
application/postscript) or `x::Vector{UInt8}` (for binary MIME types).
"""
display
"""
@spawnat
Accepts two arguments, `p` and an expression. A closure is created around the expression and
run asynchronously on process `p`. Returns a [`Future`](@ref) to the result.
"""
:@spawnat
"""
print_shortest(io, x)
Print the shortest possible representation, with the minimum number of consecutive non-zero
digits, of number `x`, ensuring that it would parse to the exact same number.
"""
print_shortest
"""
tuple(xs...)
Construct a tuple of the given objects.
```jldoctest
julia> tuple(1, 'a', pi)
(1, 'a', π = 3.1415926535897...)
```
"""
tuple
"""
eachmatch(r::Regex, s::AbstractString[, overlap::Bool=false])
Search for all matches of a the regular expression `r` in `s` and return a iterator over the
matches. If overlap is `true`, the matching sequences are allowed to overlap indices in the
original string, otherwise they must be from distinct character ranges.
"""
eachmatch
"""
num2hex(f)
Get a hexadecimal string of the binary representation of a floating point number.
```jldoctest
julia> num2hex(2.2)
"400199999999999a"
```
"""
num2hex
"""
truncate(file,n)
Resize the file or buffer given by the first argument to exactly `n` bytes, filling
previously unallocated space with '\\0' if the file or buffer is grown.
"""
truncate
"""
exp10(x)
Compute ``10^x``.
```jldoctest
julia> exp10(2)
100.0
julia> exp10(0.2)
1.5848931924611136
```
"""
exp10
"""
&(x, y)
Bitwise and.
```jldoctest
julia> 4 & 10
0
julia> 4 & 12
4
```
"""
&
"""
select(v, k, [by=<transform>,] [lt=<comparison>,] [rev=false])
Variant of `select!` which copies `v` before partially sorting it, thereby returning the
same thing as `select!` but leaving `v` unmodified.
"""
select
"""
accept(server[,client])
Accepts a connection on the given server and returns a connection to the client. An
uninitialized client stream may be provided, in which case it will be used instead of
creating a new stream.
"""
accept
"""
Mmap.Anonymous(name, readonly, create)
Create an `IO`-like object for creating zeroed-out mmapped-memory that is not tied to a file
for use in `Mmap.mmap`. Used by `SharedArray` for creating shared memory arrays.
"""
Mmap.Anonymous
"""
floor([T,] x, [digits, [base]])
`floor(x)` returns the nearest integral value of the same type as `x` that is less than or
equal to `x`.
`floor(T, x)` converts the result to type `T`, throwing an `InexactError` if the value is
not representable.
`digits` and `base` work as for [`round`](@ref).
"""
floor
"""
ErrorException(msg)
Generic error type. The error message, in the `.msg` field, may provide more specific details.
"""
ErrorException
"""
reverse(v [, start=1 [, stop=length(v) ]] )
Return a copy of `v` reversed from start to stop.
"""
reverse
"""
reverse!(v [, start=1 [, stop=length(v) ]]) -> v
In-place version of [`reverse`](@ref).
"""
reverse!
"""
UndefRefError()
The item or field is not defined for the given object.
"""
UndefRefError
"""
append!(collection, collection2) -> collection.
Add the elements of `collection2` to the end of `collection`.
```jldoctest
julia> append!([1],[2,3])
3-element Array{Int64,1}:
1
2
3
```
```jldoctest
julia> append!([1, 2, 3], [4, 5, 6])
6-element Array{Int64,1}:
1
2
3
4
5
6
```
Use [`push!`](@ref) to add individual items to `collection` which are not already
themselves in another collection. The result is of the preceding example is equivalent to
`push!([1, 2, 3], 4, 5, 6)`.
"""
append!
"""
skip(s, offset)
Seek a stream relative to the current position.
"""
skip
"""
setdiff!(s, iterable)
Remove each element of `iterable` from set `s` in-place.
"""
setdiff!
"""
copysign(x, y) -> z
Return `z` which has the magnitude of `x` and the same sign as `y`.
```jldoctest
julia> copysign(1, -2)
-1
julia> copysign(-1, 2)
1
```
"""
copysign
"""
@show
Show an expression and result, returning the result.
"""
:@show
"""
showcompact(x)
Show a compact representation of a value.
This is used for printing array elements without repeating type information (which would
be redundant with that printed once for the whole array), and without line breaks inside
the representation of an element.
To offer a compact representation different from its standard one, a custom type should
test `get(io, :compact, false)` in its normal `show` method.
"""
showcompact
"""
getfield(value, name::Symbol)
Extract a named field from a `value` of composite type. The syntax `a.b` calls
`getfield(a, :b)`.
```jldoctest
julia> a = 1//2
1//2
julia> getfield(a, :num)
1
```
"""
getfield
"""
select!(v, k, [by=<transform>,] [lt=<comparison>,] [rev=false])
Partially sort the vector `v` in place, according to the order specified by `by`, `lt` and
`rev` so that the value at index `k` (or range of adjacent values if `k` is a range) occurs
at the position where it would appear if the array were fully sorted via a non-stable
algorithm. If `k` is a single index, that value is returned; if `k` is a range, an array of
values at those indices is returned. Note that `select!` does not fully sort the input
array.
"""
select!
"""
randstring([rng,] len=8)
Create a random ASCII string of length `len`, consisting of upper- and
lower-case letters and the digits 0-9. The optional `rng` argument
specifies a random number generator, see [Random Numbers](@ref).
"""
randstring
"""
Float64(x [, mode::RoundingMode])
Create a Float64 from `x`. If `x` is not exactly representable then `mode` determines how
`x` is rounded.
```jldoctest
julia> Float64(pi, RoundDown)
3.141592653589793
julia> Float64(pi, RoundUp)
3.1415926535897936
```
See [`RoundingMode`](@ref) for available rounding modes.
"""
Float64(x)
"""
union(s1,s2...)
∪(s1,s2...)
Construct the union of two or more sets. Maintains order with arrays.
"""
union
"""
realmax(T)
The highest finite value representable by the given floating-point DataType `T`.
```jldoctest
julia> realmax(Float16)
Float16(6.55e4)
julia> realmax(Float32)
3.4028235f38
```
"""
realmax
"""
serialize(stream, value)
Write an arbitrary value to a stream in an opaque format, such that it can be read back by
[`deserialize`](@ref). The read-back value will be as identical as possible to the original. In
general, this process will not work if the reading and writing are done by different
versions of Julia, or an instance of Julia with a different system image. `Ptr` values are
serialized as all-zero bit patterns (`NULL`).
"""
serialize
"""
typemin(T)
The lowest value representable by the given (real) numeric DataType `T`.
```jldoctest
julia> typemin(Float16)
-Inf16
julia> typemin(Float32)
-Inf32
```
"""
typemin
"""
typeof(x)
Get the concrete type of `x`.
"""
typeof
"""
trunc([T,] x, [digits, [base]])
`trunc(x)` returns the nearest integral value of the same type as `x` whose absolute value
is less than or equal to `x`.
`trunc(T, x)` converts the result to type `T`, throwing an `InexactError` if the value is
not representable.
`digits` and `base` work as for [`round`](@ref).
"""
trunc
"""
unsafe_convert(T,x)
Convert `x` to a value of type `T`
In cases where [`convert`](@ref) would need to take a Julia object
and turn it into a `Ptr`, this function should be used to define and perform
that conversion.
Be careful to ensure that a Julia reference to `x` exists as long as the result of this
function will be used. Accordingly, the argument `x` to this function should never be an
expression, only a variable name or field reference. For example, `x=a.b.c` is acceptable,
but `x=[a,b,c]` is not.
The `unsafe` prefix on this function indicates that using the result of this function after
the `x` argument to this function is no longer accessible to the program may cause undefined
behavior, including program corruption or segfaults, at any later time.
"""
unsafe_convert
"""
seek(s, pos)
Seek a stream to the given position.
"""
seek
"""
popdisplay()
popdisplay(d::Display)
Pop the topmost backend off of the display-backend stack, or the topmost copy of `d` in the
second variant.
"""
popdisplay
"""
cglobal((symbol, library) [, type=Void])
Obtain a pointer to a global variable in a C-exported shared library, specified exactly as
in [`ccall`](@ref).
Returns a `Ptr{Type}`, defaulting to `Ptr{Void}` if no `Type` argument is
supplied.
The values can be read or written by [`unsafe_load`](@ref) or [`unsafe_store!`](@ref),
respectively.
"""
cglobal
"""
endof(collection) -> Integer
Returns the last index of the collection.
```jldoctest
julia> endof([1,2,4])
3
```
"""
endof
"""
next(iter, state) -> item, state
For a given iterable object and iteration state, return the current item and the next iteration state.
```jldoctest
julia> next(1:5, 3)
(3, 4)
julia> next(1:5, 5)
(5, 6)
```
"""
next
"""
sizehint!(s, n)
Suggest that collection `s` reserve capacity for at least `n` elements. This can improve performance.
"""
sizehint!
"""
OutOfMemoryError()
An operation allocated too much memory for either the system or the garbage collector to
handle properly.
"""
OutOfMemoryError
"""
finalize(x)
Immediately run finalizers registered for object `x`.
"""
finalize
"""
BoundsError([a],[i])
An indexing operation into an array, `a`, tried to access an out-of-bounds element, `i`.
"""
BoundsError
"""
invoke(f, types <: Tuple, args...)
Invoke a method for the given generic function matching the specified types, on
the specified arguments. The arguments must be compatible with the specified types. This
allows invoking a method other than the most specific matching method, which is useful when
the behavior of a more general definition is explicitly needed (often as part of the
implementation of a more specific method of the same function).
"""