INFO1110 Lecture Notes - Lecture 13: 8-Bit, Arbitrary-Precision Arithmetic, Floating Point

175 views5 pages

Document Summary

Data types, multi-dimensional arrays, and numpy numpy numpy is a python module that gives access to native data types in the cpu. Note: in semester 1 2018, numpy specifically was not assessed in the final exam, mainly focusing on arrays in general, not how they could be implemented in python specifically. 3 bits 23 = 8 possible values. Integers in numpy import numpy as np x = np. uint8(34) Integer overflow occurs when we try to represent values outside the allowable range. Floats represent fractional/decimal numbers in scientific notation with base 2. Typical floats use 4 bytes of memory, but python 3 has arbitrary precision. Has three parts, the sign, mantissa/coefficient, and the exponent. Floats in numpy import numpy as np x = np. float32(3. 1415296) Arrays: collection of a single data type, contiguous in memory (no gaps, python has arrays based on c numpy arrays. Each array has its own index, e. g. arr[0][1]

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents