Anonymous user
Elliptic curve arithmetic: Difference between revisions
→{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details
(Added Kotlin) |
(→{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details) |
||
Line 708:
=={{header|Kotlin}}==
{{trans|C}}
<lang scala>// version 1.1.
const val C = 7
Line 714:
class Pt(val x: Double, val y: Double) {
val zero get() = Pt(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY)
val isZero get() = x > 1e20 || x < -1e20
Line 723:
return Pt(t, l * (x - t) - y)
}
operator fun unaryMinus() = Pt(x, -y)
|