i want to write the next function using pipeline:
A = 1/Sum[1-k](x^2)
so when i write:
//Adaptive step
let a_Adaptive x =
x
|> Array.map (fun x -> x ** 2.0)
|> Array.sum
|> (**) -1.0
f# interpretes (**)
as a multiline comment, but i want use it as a function.
Any suggestions?
On Sept. 26, a flurry of detonations on two underwater pipelines connecting Russia to Germany sent gas spewing to the surface of the Baltic Sea. The explosions triggered four gas leaks at four locations — two in Denmark's exclusive economic zone and two in Sweden's exclusive economic zone.
Russia's defence ministry said on Saturday that British navy personnel blew up the Nord Stream gas pipelines, a claim that London said was false. Sweden and Denmark have both concluded that four leaks on Nord Stream 1 and 2 were caused by explosions, but have not said who might be responsible.
A pipeline operator—also known as a pump operator, gauger or gas operator—is a technical professional who controls the flow of gas, oil and other materials through pipelines.
It is operated by Nord Stream AG. Nord Stream 2 (NS2) runs from Ust-Luga in northwestern Russia near Estonia. The pipeline was built in order to increase gas exports towards Europe, aiming to double annual capacity. The project was completed in 2021, but has not yet entered service.
The construction of the pipeline started in 2011, to expand the Nord Stream 1 line and double annual capacity to 110 billion cubic metres (3.9 trillion cubic feet). It was completed in September 2021, but has not yet entered service.
You just need to add a space before the **
:
let a_Adaptive x =
x
|> Array.map (fun x -> x ** 2.0)
|> Array.sum
|> ( ** ) -1.0
From the F# specification:
To define other operators that begin with
*
, whitespace must follow the opening parenthesis; otherwise(*
is interpreted as the start of a comment:let ( *+* ) x y = (x + y)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With