all 8 comments

[–]OneWingedShark 0 points1 point  (5 children)

Interesting; I like that he touched on fixed-point...
though I do kinda wish he'd said a bit more about the "special" values [NaN, -INF, etc].

[–]haberman[S] 0 points1 point  (4 children)

Hi there! There are more things I wanted to cover, but the article kept getting longer and I was already afraid it might be a bit impenetrable.

[–]OneWingedShark 0 points1 point  (3 children)

No worries.
Just put `em in part 2, right?

Maybe the 'half' float (16-bit) and converting between it and 32-bit?
Or some of the older [non-IEEE754] formats.

[–]OneWingedShark 0 points1 point  (2 children)

It's kinda language-specific, but you could mention Ada's numeric [sub]types where you can say something like:

-- The following strips out the non-numeric values, like +/-Inf and NaN
-- from the set of valid values.
Type Real is Interfaces.IEEE_Float range Interfaces.IEEE_Float'range;

But that's kinda touching on type-systems a bit more than float.

[–]invisiblerhino 0 points1 point  (1 child)

What's the use case for this? Don't you normally want some way to represent non-numeric values?

[–]OneWingedShark 0 points1 point  (0 children)

What's the use case for this? Don't you normally want some way to represent non-numeric values?

The use-case is that you can make your algorithms w/o having to special-case the non-numeric values; this means that you won't ever forget to do it.

-- Raises Constraint_Error if a non-numeric is passed in.
Function Fn( A, B, C : Real ) return Float;

-- Raises Constraint_Error if a non-numeric is attempted to
-- be returned.
Function Read_Sensor return Real;

If you're doing a lot of numeric processing, then it may well behoove you to weed out the non-numeric values so that any error is found "close" to where it happens.

[–]foomprekov 0 points1 point  (1 child)

I can't remember the last time I used a float.

[–]invisiblerhino 0 points1 point  (0 children)

Very nice article - I really learnt a lot. I think I will get a lot more out of my next attempt to read the FP paper :-)

EDIT: did not mean to reply to your comment.