Haskell, 54 bytes
f l|t<-sum$abs<$>l=[i|i<-[-t..t],foldl1((+).(i*))l==0]
Brute force and synthetic division.
Ungolfed with UniHaskell and -XUnicodeSyntax
import UniHaskell
roots ∷ Num a ⇒ [a] → [a]
roots xs = [r | r ← -bound ... bound, foldl1 ((+) ∘ (r ×ばつ)) xs ≡ 0]
where bound = sum $ abs § lxs
Alternate solution, 44 bytes
Credit to nimi.
f l=[i|i<-[minBound..],foldl1((+).(i*))l==0]
Good luck with trying it online, as this checks every number in an Int's range.
Haskell, 54 bytes
f l|t<-sum$abs<$>l=[i|i<-[-t..t],foldl1((+).(i*))l==0]
Brute force and synthetic division.
Ungolfed with UniHaskell and -XUnicodeSyntax
import UniHaskell
roots ∷ Num a ⇒ [a] → [a]
roots xs = [r | r ← -bound ... bound, foldl1 ((+) ∘ (r ×ばつ)) xs ≡ 0]
where bound = sum $ abs § l
Alternate solution, 44 bytes
Credit to nimi.
f l=[i|i<-[minBound..],foldl1((+).(i*))l==0]
Good luck with trying it online, as this checks every number in an Int's range.
Haskell, 54 bytes
f l|t<-sum$abs<$>l=[i|i<-[-t..t],foldl1((+).(i*))l==0]
Brute force and synthetic division.
Ungolfed with UniHaskell and -XUnicodeSyntax
import UniHaskell
roots ∷ Num a ⇒ [a] → [a]
roots xs = [r | r ← -bound ... bound, foldl1 ((+) ∘ (r ×ばつ)) xs ≡ 0]
where bound = sum $ abs § xs
Alternate solution, 44 bytes
Credit to nimi.
f l=[i|i<-[minBound..],foldl1((+).(i*))l==0]
Good luck with trying it online, as this checks every number in an Int's range.
Haskell, 54 bytes
f l|t<-sum$abs<$>l=[i|i<-[-t..t],foldl1((+).(i*))l==0]
Brute force and synthetic division.
Ungolfed with UniHaskell and -XUnicodeSyntax
import UniHaskell
roots ∷ Num a ⇒ [a] → [a]
roots xs = [r | r ← -bound ... bound, foldl1 ((+) ∘ (r ×ばつ)) xs ≡ 0]
where bound = sum $ abs § l
Alternate solution, 44 bytes
Credit to nimi.
f l=[i|i<-[minBound..],foldl1((+).(i*))l==0]
Good luck with trying it online, as this checks every number in an Int's range.
Haskell, 54 bytes
f l|t<-sum$abs<$>l=[i|i<-[-t..t],foldl1((+).(i*))l==0]
Brute force and synthetic division.
Ungolfed with UniHaskell and -XUnicodeSyntax
import UniHaskell
roots ∷ Num a ⇒ [a] → [a]
roots xs = [r | r ← -bound ... bound, foldl1 ((+) ∘ (r ×ばつ)) xs ≡ 0]
where bound = sum $ abs § l
Alternate solution, 44 bytes
f l=[i|i<-[minBound..],foldl1((+).(i*))l==0]
Good luck with trying it online, as this checks every number in an Int's range.
Haskell, 54 bytes
f l|t<-sum$abs<$>l=[i|i<-[-t..t],foldl1((+).(i*))l==0]
Brute force and synthetic division.
Ungolfed with UniHaskell and -XUnicodeSyntax
import UniHaskell
roots ∷ Num a ⇒ [a] → [a]
roots xs = [r | r ← -bound ... bound, foldl1 ((+) ∘ (r ×ばつ)) xs ≡ 0]
where bound = sum $ abs § l
Alternate solution, 44 bytes
Credit to nimi.
f l=[i|i<-[minBound..],foldl1((+).(i*))l==0]
Good luck with trying it online, as this checks every number in an Int's range.
Haskell, 54 bytes
f l|t<-sum$abs<$>l=[i|i<-[-t..t],foldl1((+).(i*))l==0]
Brute force and synthetic division.
Ungolfed with UniHaskell and -XUnicodeSyntax
import UniHaskell
roots ∷ Num a ⇒ [a] → [a]
roots xs = [r | r ← -bound ... bound, foldl1 ((+) ∘ (r ×ばつ)) lxs ≡ 0]
where bound = sum $ abs § lAlternate solution, 44 bytes
f l=[i|i<-[minBound..],foldl1((+).(i*))l==0]
Good luck with trying it online , as this checks every number in an Int's range.
Haskell, 54 bytes
f l|t<-sum$abs<$>l=[i|i<-[-t..t],foldl1((+).(i*))l==0]
Brute force and synthetic division.
Ungolfed with UniHaskell and -XUnicodeSyntax
import UniHaskell
roots ∷ Num a ⇒ [a] → [a]
roots xs = [r | r ← -bound ... bound, foldl1 ((+) ∘ (r ×ばつ)) l ≡ 0]
where bound = sum $ abs § l
Haskell, 54 bytes
f l|t<-sum$abs<$>l=[i|i<-[-t..t],foldl1((+).(i*))l==0]
Brute force and synthetic division.
Ungolfed with UniHaskell and -XUnicodeSyntax
import UniHaskell
roots ∷ Num a ⇒ [a] → [a]
roots xs = [r | r ← -bound ... bound, foldl1 ((+) ∘ (r ×ばつ)) xs ≡ 0]
where bound = sum $ abs § lAlternate solution, 44 bytes
f l=[i|i<-[minBound..],foldl1((+).(i*))l==0]
Good luck with trying it online , as this checks every number in an Int's range.