8 votes

Explaining to students why to use double instead of float (unless there's a very good reason)

Luckily this is quite simple to make clear, even if you are steering clear of the IEEE standard. Honestly, even binary is not needed here. I would start by borrowing a page from Scheme, and say that ...
Ben I.'s user avatar
  • 32.7k
6 votes
Accepted

Explaining to students why to use double instead of float (unless there's a very good reason)

Better yet, is there any way I can show the students such an explanation? (Perhaps an online, interactive demonstration of floating point precision etc. - I couldn't find one) Show them these bits of ...
Kevin Workman's user avatar
5 votes

Explaining to students why to use double instead of float (unless there's a very good reason)

Tell the students they have seven decimal digits of precision in a float, and that the decimal point is placed "somewhere" within those seven digits, depending on the magnitude of the number. Ask ...
Bob Brown's user avatar
  • 409
2 votes

Explaining to students why to use double instead of float (unless there's a very good reason)

Actually, it isn't quite so clear. If I run this in Java: ...
Buffy's user avatar
  • 35.8k
1 vote

What is a fairly exhaustive list for how decimal numbers are written in source code?

3.14e2 3.14e-67f .14E4f 0x10.1p0 0x1p5 0x1e5 3.14'15'92 3.14e-4932l 3.14e38f 3.14e38 3.14e38l 3.14_15F 10_000_000.0 +1.23E+1 3.1415926D0 5.d0 1. 0xfadebeep-8
1 vote

Creating a rubric for computer arithmetic

I missed this question! I will attempt to provide feedback in parts: I am concerned that there are too many critiera. I don't understand the reason for this concern, so I cannot comment upon it. The ...
Ben I.'s user avatar
  • 32.7k
1 vote

Explaining to students why to use double instead of float (unless there's a very good reason)

Simple demonstration of "precision" using handheld calculators. Get a pair of calculators. One cheap model that has a limited number of digits in its display. Models can be found built in to ...
Gypsy Spellweaver's user avatar
1 vote

Explaining to students why to use double instead of float (unless there's a very good reason)

Many compilers will promote floats to doubles, do the calculation, and cast back. I see little or no reason to use floats unless one is dealing with huge matrices of floating-point numbers. I ...
ncmathsadist's user avatar
  • 2,319

Only top scored, non community-wiki answers of a minimum length are eligible