"Allen " <email@example.com> wrote in message news:firstname.lastname@example.org... > I am working on project Euler and one of the problems asks you to find the > largest product of 5 consecutive numbers in a given 1000 digit number. My > question is how do I input this number without Matlab rounding?
No 1000-digit number can be represented as a finite double precision value (unless the first 700ish digits are 0.) They will all overflow to Inf or -Inf. Use Symbolic Math Toolbox instead.
a = sym('123456789012345678901234567890')
Note that the quotes are NECESSARY otherwise MATLAB will interpret your string of 1000 digits as a double then convert the resulting Inf into a symbolic object.