There are two kinds of developers: those for whom generics are natural and those who use 1) copy/paste/modify and 2) subtype polymorphism.
You can simulate generics by 1) and 2).
"All things being equal" of course. It's magic numbers that is worrying. converting Fortran code for Ahrens/Dieter random variates directly to C, GOTOS and all.Copy/paste is sometimes the best choice
- Adam SmithIt is the great multiplication of the productions of all the different arts, in consequence of the division of labour, which occasions, in a well-governed society, that universal opulence which extends itself to the lowest ranks of the people.
Hello: proc options(main);
put list ('Hello world');
end Hello;
namespace Quantum.HelloWorld
{
open Microsoft.Quantum.Canon;
open Microsoft.Quantum.Primitive;
operation SayHello () : Unit {
Message("Hello World!");
}
}
Quantum Canons are the future.Whoa.
package main
import (
"fmt"
"github.com/branda22/blackscholes/blackscholes"
)
func main() {
option := &blackscholes.Option{
StrikePrice: 3500,
TimeToExpiration: 87,
Type: "CALL",
}
underlying := &blackscholes.Underlying{
Symbol: "BTC_USD",
Price: 4410.00,
Volatility: .8915,
}
bs := blackscholes.NewBlackScholes(option, underlying, .0102)
fmt.Println("delta", bs.Delta)
fmt.Println("IV", bs.ImpliedVolatility)
fmt.Println("Theo price", bs.TheoPrice)
fmt.Println("Theta", bs.Theta)
}
to say-hi
print "Hello, world!"
end