blob: ca5dcbc9928e26d84528bf0303bae81bb020d0a9 [file]
## examples/bigdecimal.av
let a = 2M;
let err = 1e-15M;
let root = a;
p("type of a is: #{type(a)}");
p("type of err is: #{type(err)}");
while math.abs(a - root * root) > err {
root = (a/root + root) / 2.0M;
}
p("square root of 2M is: #{root}");