Skip to content

Instantly share code, notes, and snippets.

@ezura
Last active June 18, 2017 09:12
Show Gist options
  • Select an option

  • Save ezura/eef428f3c572958c2e0e9bfca9ce4e87 to your computer and use it in GitHub Desktop.

Select an option

Save ezura/eef428f3c572958c2e0e9bfca9ce4e87 to your computer and use it in GitHub Desktop.
整数リテラルは Int になる。*literalConvertible 的なものはない?暗黙的型変換がないとのこと。型変換するときはメソッドを使う。Swift と違い、変換元の方が変換の責任を持っているように見える。
val i: Double = 1 // 型 error
val i_: Double = 1.toDouble()
@ezura
Copy link
Copy Markdown
Author

ezura commented Jun 18, 2017

Number とは別に Comparable を準拠している
Double private constructor() : Number(), Comparable
public interface Comparable

@ezura
Copy link
Copy Markdown
Author

ezura commented Jun 18, 2017

数値系だと、この記事も合わせて見ておきたい
http://qiita.com/d_date/items/b3562f542afc306791ce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment