Difference between revisions of "W2031 Designing a Floating Point Type"
From Coder Merlin
(Created page with "thumb|Evergreen Point Floating Bridge == Prerequisites == == Background == == Introduction == == Topic...") |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[File:Evergreen Point Floating Bridge eastbound from HOV lane.jpg|thumb|Evergreen Point Floating Bridge]] | [[File:Evergreen Point Floating Bridge eastbound from HOV lane.jpg|thumb|Evergreen Point Floating Bridge]] | ||
== Prerequisites == | |||
== Background == | |||
== Introduction == | |||
== Topic Headers == | |||
== Key Concepts == | |||
== Exercises == | |||
* | {{W2031-Exercises}} | ||
* | |||
* | == References == | ||
* | * [https://en.wikipedia.org/wiki/Double-precision_floating-point_format Double Precision Floating Point Format] (Wikipedia) | ||
* | * [http://bartaz.github.io/ieee754-visualization/ IEEE754 Visualization] (Bartaz) | ||
* [https://www.h-schmidt.net/FloatConverter/IEEE754.html IEEE754 Floating Point Converter] (Schmidt) | |||
* [https://www.h-schmidt.net/FloatConverter/IEEE754.html Converting to IEEE754 Form] (IA State) | |||
* [https://github.com/jwiegley/gdtoa Conversion Library] (David M. Gay) |
Latest revision as of 09:09, 13 November 2020
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder
Prerequisites[edit]
Background[edit]
Introduction[edit]
Topic Headers[edit]
Key Concepts[edit]
Exercises[edit]
Exercises
- Design a struct named Real whose member properties may only be of type Int or Bool.
- Define initializers:
init(_ d:Double)
init(_ n:Int)
- Define functions for addition, subtraction, multiplication, and division.
- All such functions should take the form:
func operationName(_ other:Real) -> Real
- These functions should be named add, subtract, multiply, and divide
- All such functions should take the form:
References[edit]
- Double Precision Floating Point Format (Wikipedia)
- IEEE754 Visualization (Bartaz)
- IEEE754 Floating Point Converter (Schmidt)
- Converting to IEEE754 Form (IA State)
- Conversion Library (David M. Gay)