Elliptic curve arithmetic: Difference between revisions

Content added Content deleted
(Added 11l)
(→‎{{header|Wren}}: Now uses new core library function.)
Line 2,240: Line 2,240:
{{trans|C}}
{{trans|C}}
{{libheader|Wren-fmt}}
{{libheader|Wren-fmt}}
{{libheader|Wren-math}}
<lang ecmascript>import "/fmt" for Fmt
<lang ecmascript>import "/fmt" for Fmt
import "/math" for Math


var C = 7
var C = 7
Line 2,257: Line 2,255:
y { _y }
y { _y }


static fromNum(n) { Pt.new(Math.cbrt(n*n - C), n) }
static fromNum(n) { Pt.new((n*n - C).cbrt, n) }


isZero { x > 1e20 || x < -1e20 }
isZero { x > 1e20 || x < -1e20 }