Question: Python 2b) Write a function (by completing the template below) to produce a numpy array containing the sorted gamut of normalized representable positive numbers for
Python

2b) Write a function (by completing the template below) to produce a numpy array containing the sorted gamut of normalized representable positive numbers for a floating point system with 3 binary digits of precision and 3 binary digits for specifying the exponent. Hints: Start by computing the number no of normalized mantissa values described by 3 digits and the symmetric range (emin, emax) of 3-digit exponents. Create a 1D array of length no and and store the representable values corresponding to exponent e = 0. Create a 1D array of size 29 and store the values of 2e for e in the representable range of exponents. Create a 2D array of size n0 x 29 and use a doubly nested loop to store the product of each mantissa with each exponential. Find numpy functions to flatten and sort the list. In [ ]: import numpy as np def pos_gamut3(): compute the representable values for a floating point system Args: NONE Returns: numpy array of normalized positive values for 3 digits and 3-bit exponent # YOUR CODE HERE raise Not ImplementedError() return vals
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
