Programming Logic and Design

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/6

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:48 AM on 8/3/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

7 Terms

1
New cards

Floating -point numbers

< Represent numbers with a decimal place like 3.1415927, 0.0000625, and 10.2 >

2
New cards

What are the Floating-point numbers?

Floating-point numbers in C++ represent signed real numbers with fractional parts, stored similarly to scientific notation. They follow the IEEE 754 standard, organizing data into a sign bit, exponent, and mantissa. Three primary built-in types handle non-integer values.

3
New cards

Float

Single precision. Uses 4 bytes of memory. Offers ~7 significant digits of precision.

4
New cards

Double

Double precision. Uses 8 bytes of memory. Offers ~15 significant digits of precision.

5
New cards

Long Double

Extended precision. Uses 8, 12, or 16 bytes depending on the system.

6
New cards

2 ways to be expressed

- Fixed point (decimal) notation: 31.4159, 0.0000625

- E notation: 3.14159E1, 6.25e-5

7
New cards

Double by default

They are double by default. Can be forced to be float = 3.14159F or long double = 0.0000625L. If a floating-point value is assigned to an integer variable, the fractional part will be truncated (i.e., 'chopped off' and discarded). Example:

int rainfall = 3.88;

cout << rainfall; // Displays 3 only