MilesCranmer commited on
Commit
5fcecfa
1 Parent(s): ea4213e

Add operator for safe power

Browse files
Files changed (1) hide show
  1. operators.jl +2 -1
operators.jl CHANGED
@@ -1,3 +1,4 @@
1
- # Define allowed operators
2
  plus(x::Float32, y::Float32)::Float32 = x+y
3
  mult(x::Float32, y::Float32)::Float32 = x*y;
 
 
1
+ # Define allowed operators. Any julia operator can also be used.
2
  plus(x::Float32, y::Float32)::Float32 = x+y
3
  mult(x::Float32, y::Float32)::Float32 = x*y;
4
+ pow(x::Float32, y::Float32)::Float32 = sign(x)*abs(x)^y;