I am trying to find the square root of 2 to 100 decimal places, but it only shows to like 10 by default, how can I change this?
decimal module comes in handy.
>>> from decimal import * >>> getcontext().prec = 100 >>> Decimal(2).sqrt() Decimal('1.414213562373095048801688724209698078569671875376948073176679737990732478462107038850387534327641573')
1.4m articles
1.4m replys
5 comments
57.0k users