How to get full width of screen, when using large calculation with bc ?

Experts,

When doing large calculation the digits in the screen are limiting to 68 digit and then with a \ ( backspace) next line comes.

example:

ubuntu# echo "123456789 ^ 50 " | bc
37648602365872212683379005814670372328125515868188009630652959693316\
53227365756802769371000498888439396270561551204407017528155137509115\
30628997783758432567282528393435095577700662612703064145756763013199\
75186423794103895309927964392119588899253858187348437967568218742276\
11388639044429599087967879460298055070549932421946383277897148516959\
04443763894833957041176045572066607958236727487504380299754283001
# 

My screen is big enough with good resolution , but the lines are not spreading in the entire screen. Any advise,

The output wanted to be spread to 255 width , Like below:

37648602365872212683379005814670372328125515868188009630652959693316532273657568027693710004988884393962705615512044070175281551375091153062899778375843256728252839343509557770066261270306414575676301319975186423794103895309927964392119588899
2538581873484379675682187422761138863904442959908796787946029805507054993242194638327789714851695904443763894833957041176045572066607958236727487504380299754283001

Thanks,

Don't think bc supports wide output.

It uses readline, however so there are no issues with editing wide input lines, so that is one thing I suppose.

1 Like

Try the following

echo "123456789 ^ 50" | bc | tr -d '\n\\' | fold -w 255
1 Like

fpmurphy ,
That works great , thanks a lot....

awk 'BEGIN {print 1234567^50}'

awk does not support as large number as bc does.