2016년 8월 3일 수요일

Julia 연습 13

In [ ]:
#
# 나는 julia 를 사랑하는가
#
In [1]:
x = 12
Out[1]:
12
In [2]:
typeof(x)
Out[2]:
Int64
In [3]:
convert(UInt8, x)
Out[3]:
0x0c
In [4]:
typeof( ans)
Out[4]:
UInt8
In [5]:
convert(::Type{Bool}, x::Real) = x==0 ? false : x==1 ? true : throw(InexactError())
LoadError: error in method definition: function Base.convert must be explicitly imported to be extended
while loading In[5], in expression starting on line 1
In [6]:
# 여러개의 타입이 있을때,
# 하나의 공통타입으로 변환하는것을 promotion 이라 부른다.

promote( 1, 2.5)
Out[6]:
(1.0,2.5)
In [7]:
typeof( promote_rule)
Out[7]:
Function

Firefly Algorithms

firefly algorithm 001 Firefly Algorithms ¶ 반딧불 알고리즘 번역 요약 ¶ References [1] X. S. Y...