netlogo quad
public text v1 · immutableglobals [placeholder largeroot smallroot]
to sum-me
let total 0
let i 0
repeat N [
set i i + 1
set total total + i
]
set placeholder total
end
to calcquad
let disc b * b - 4 * a * c
ifelse disc < 0
[set largeroot "imaginary"
set smallroot "imaginary"]
[ let r1 (0 - b + sqrt disc) / (2 * a)
let r2 (0 - b - sqrt disc) / (2 * a)
ifelse r1 >= r2
[set largeroot r1
set smallroot r2]
[set largeroot r2
set smallroot r1]
]
end