質問編集履歴
2
参考サイトにtraitを追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -92,6 +92,18 @@
|
|
92
92
|
|
93
93
|
object DoubleAsIfIntegral extends DoubleAsIfIntegral with DoubleOrdering
|
94
94
|
|
95
|
+
|
96
|
+
|
97
|
+
//scala.math.NumericのType Members
|
98
|
+
|
99
|
+
trait IntIsIntegral
|
100
|
+
|
101
|
+
trait DoubleIsFractional extends DoubleIsConflicted with Fractional[Double]
|
102
|
+
|
103
|
+
trait DoubleAsIfIntegral extends DoubleIsConflicted with Integral[Double]
|
104
|
+
|
105
|
+
|
106
|
+
|
95
107
|
```
|
96
108
|
|
97
109
|
|
1
参考サイトを追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -71,3 +71,33 @@
|
|
71
71
|
「型クラスのインスタンス」`IntIsIntegral`, `DoubleAsIfIntegral`はどのように探せばよいのでしょうか?
|
72
72
|
|
73
73
|
全然検討がつきません。
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
# 参考サイト(追記)
|
80
|
+
|
81
|
+
関係ありそうなクラスの定義を、[Numericのサイト](https://www.scala-lang.org/api/current/scala/math/Numeric$.html)から引用しました。
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
```scala
|
86
|
+
|
87
|
+
//scala.math.NumericのValue Members
|
88
|
+
|
89
|
+
implicit object IntIsIntegral extends IntIsIntegral with IntOrdering
|
90
|
+
|
91
|
+
implicit object DoubleIsFractional extends DoubleIsFractional with DoubleOrdering
|
92
|
+
|
93
|
+
object DoubleAsIfIntegral extends DoubleAsIfIntegral with DoubleOrdering
|
94
|
+
|
95
|
+
```
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
[implicit object IntIsIntegral](https://www.scala-lang.org/api/current/scala/math/Numeric$$IntIsIntegral$.html)
|
100
|
+
|
101
|
+
[implicit object DoubleIsFractional](https://www.scala-lang.org/api/current/scala/math/Numeric$$DoubleIsFractional$.html)
|
102
|
+
|
103
|
+
[object DoubleAsIfIntegral](https://www.scala-lang.org/api/current/scala/math/Numeric$$DoubleAsIfIntegral$.html)
|