Save this video free

Lecture 20: Floating-point; Pointers

Burton Ma · 47:51 · Watch on YouTube

Part of Queen's University CISC220. See all 17 lectures and search them

These notes were made with YouTube Collector. Paste any YouTube link and get the same: a summary, chapters and a searchable transcript.

Overview

Burton Ma reviews C floating-point types, IEEE 754 special values, math-library functions, and printf formatting before introducing pointers as typed memory addresses. He explains NULL checks, address-of and dereference operators, void-pointer casts, and why pass-by-value prevents a conventional swap function from changing caller variables; passing their addresses lets swap modify the original doubles.

Key takeaways

Chapters

0:00 C Floating-Point Types, IEEE 754 Infinity, and NaN
4:35 math.h Functions, C Function Names, and Linking with -lm
7:16 printf Floating-Point Precision and Minimum Field Width
14:33 Pointer Types, Declarations, and Object Lifetimes
21:10 NULL Pointers: Checks, Sentinels, and Error Results
26:17 Address-of (&) and Dereferencing (*) in C
31:46 Writing Through Pointers and the Risk of Undefined Behavior
34:02 void * Pointers, Array Addresses, and Type Casts
40:07 Pass-by-Value and Swapping Caller Variables with Pointers

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:01 All right, good afternoon everybody. Um so, we've got two notebooks to work through today, or one and a half anyway. Uh the first notebook is the notebook describing floating point types. Most of this should be reviewed to you uh because the floating point types behave the same in C as they do in Java. Um so, in C, you've got three floating point types. You've got float, uh you have double, and you've got long double. Float and double in C are the same as float and double in Java. Uh Java does not have long double as far as I know, although that may have changed by um as far as I know, there is no long double in Java. Um so, in this course, if you're going to use if you need a floating point number, typically you just reach for a double. That's normally the default uh floating point type. Uh and so, double just means double

0:49 precision floating point arithmetic, uh which is the name of the type described by that, the IEEE 754 standard. Uh so, just a quick mention, there is a header file called float.h. There are some constants there that describe the limits of the floating point numbers, um if you ever need them. Uh now, we never actually go into detail in describing exactly how floating point numbers work. Um so, we never describe to you what a mantissa is, or what a signific Well, you might know what a significant is. Um things like that. So, these constants probably don't make a lot of sense to you. Um if you need them for some reason though, they're in float.h. Most of the time, if you're working with doubles, you're probably doing some math. So, if you want access to the

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

In this course

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Burton Ma.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.