-3

I have a number that comes from Sigmoid function like '1.108779411784206406864790428E-69' but it's naturally should be between 0-1. How can I represent it in that way? Thanks

2 Answers2

1

The number that you got is the scientific notation of this number: 0.0000000000000000000000000000000000000000000000000000000000000000000011087794117842064068647904281594

To get the number like that, you need to do this:

x = 1.108779411784206406864790428E-69
print("%.100f" % x)

"%.100f" is the string to format, where 100 is the number of floats you need to show.

Jose Esparza
  • 292
  • 1
  • 8
1

You can use the format statement to print. The original value is a float. For the convenience of readability python prints in scientific notation since this is a very small number. You can print upto more decimal places.. I have printed upto 96 decimal places below.

>>> a=1.108779411784206406864790428E-69
>>> "{:.96f}".format(a)
'0.000000000000000000000000000000000000000000000000000000000000000000001108779411784206406864790428'

Hope this helps.

Nick Rogers
  • 328
  • 1
  • 5
  • 16