Jul-07-2017, 12:05 AM
I'm still not sure what you're trying to do, but to use a 'list' in python
(which is an array), and split off the mantissa and exponent of a float,
you can use something like:
(which is an array), and split off the mantissa and exponent of a float,
you can use something like:
p = [2.07155254, -20.60156854, 19.5483871, 4.19432936] # Split mantissa and exponent for n, value in enumerate(p): parts = str(value).split('.') print('Value: {}, mantissa: {}, exponent: {}'.format(n, parts[0], parts[1]))which will produce:
Output:Value: 0, mantissa: 2, exponent: 07155254
Value: 1, mantissa: -20, exponent: 60156854
Value: 2, mantissa: 19, exponent: 5483871
Value: 3, mantissa: 4, exponent: 19432936