From: us on 11 May 2010 21:42 "Dustin " <matlab_newsgroup(a)iforgot.us> wrote in message <hs7unm$ouu$1(a)fred.mathworks.com>... > I'm trying to figure out how to get fprintf to display large decimal numbers in their entirety. This is what I've been getting: > > >> fprintf('%ld\n',intmax('uint64')) > 1.844674e+19 > > Instead, I'd like this to return the entire number: 18446744073709551615. Any hints on the appropriate format string to pass it? > > Thanks! > Dustin sadly enough: a known problem with S/FPRINTF... one of the (tedious) solutions % the macro fh=@(x) strtrim(evalc('disp(x)')); % <- for non-ints depending on FORMAT(!)... % ...applied r=sprintf('%s',fh(intmax('uint64'))) % <- or FPRINTF(fp,...)... % r = 18446744073709551615 us |