Settings

Theme

What is the ‘range’ of a number type?

lemire.me

8 points by tgymnich 4 years ago · 2 comments

Reader

synack 4 years ago

This is one of the things Ada does really well. The standard says that the range of Float is implementation defined, but a program can reference the 'First and 'Last attributes of the Float type to determine the actual bounds for the compiler and runtime.

http://www.ada-auth.org/standards/2xaarm/html/AA-3-5-7.html

quantified 4 years ago

Better title: “What is the range of a number type for types recognized by C++”?

The range of numbers represented by an IEEE-754 floating-point is discontinous on the number line at any given precision. So there are a variety of possible answers with varying usefulness.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection