Questions tagged [denormal-numbers]
13 questions
33
votes
4 answers
What is this "denormal data" about ? - C++
I would like to have a broad view about "denormal data" and what it's about because the only thing that I think I got right is the fact that is something especially related to floating point values from a programmer viewpoint and it's related to a…

user1849534
- 2,329
- 4
- 18
- 20
5
votes
0 answers
A robust, portable way to set flush-denormals-to-zero?
I'm working with some code which uses inline Intel X86_64 assembly to set the processor's SSE flags to include flush-denormal-to-zero and treat-denormals-as-zero: stmxcsr and then ldmxcsr.
I don't particularly like that approach (which we shall…

einpoklum
- 118,144
- 57
- 340
- 684
3
votes
1 answer
cmpeqpd sometimes returns wrong values
For some reason, sometimes in my program I see that
cmpeqpd xmm3,xmm0
where xmm0 == {0x2cd000000000, 0x2cd000000000}
and xmm3 == {0x0, 0x2011d0800000000}
happens to return {0xffffffffffffffff, 0x0} in xmm3, which is, well, wrong, since (double)0x0…

Bikineev
- 1,685
- 15
- 20
3
votes
3 answers
Proper handling of denormal floats in ISO-Prolog
Denormal floats are something special:
What does the ISO-Prolog standard say on how these should be handled?
It is clear to me that raising a evaluation_error(underflow) exception whenever these denormals occur is a proper way of dealing with them,…

repeat
- 18,496
- 4
- 54
- 166
3
votes
0 answers
Denormalized floating point numbers: which operations trigger expensive special cases?
Denormalized floating point numbers require expensive special handling in some operations (additions, multiplications). While this is well-known, it seems to me that there are also many comparably simple operations might not be affected by such a…

Wenzel Jakob
- 555
- 6
- 14
2
votes
1 answer
What does the "denormal input" exactly mean in assembly when we consider using DAZ flag for SSE Floating Points
I've read This article and do-denormal-flags-like-denormals-are-zero-daz-affect-comparisons-for-equality and I understand the usage and difference between FTZ and DAZ flags.
DAZ applies on input, FTZ on output from an FP operation.
What confused me…

lionel
- 415
- 1
- 5
- 14
1
vote
0 answers
Does ieee 754 account for x86's DAZ mode?
X86 has two interesting flags that can be set in the dynamic floating-point environment which affect treatment of subnormals. FTZ (flush-to-zero) says that in any case when a subnormal result would be produced, 0 is produced instead. DAZ…

Moonchild
- 483
- 1
- 4
- 15
1
vote
1 answer
Confusion regarding floating point representation
I've been reading an article by Dr William T. Verts titled An 8-Bit Floating Point Representation where the author defines, as the title suggests, an 8-bit floating point representation with one bit for sign, three bits for exponent and the…

Aniruddha
- 774
- 1
- 7
- 18
1
vote
2 answers
How to check if a float is positive denormalized/negative denormalized or not denormalized
How to check if a float is positive denormalized/negative denormalized or not denormalized.
I tried to do:
int is_denorm(float f)
{
unsigned int x = *(int*)&f;
unsigned expMask = (1 << 8) - 1;
expMask = expMask << 23;
//now needs to check…

Nico
- 11
- 4
1
vote
2 answers
denormalize the product of 2 floating point numbers or not
I'm trying to multiply 2 floating point numbers without using the floating point instructions.
Everything was going well until I came across denormalized numbers. How do I know whether I should normalize or denormalize the product? This uncertainty…
user8242042
0
votes
1 answer
FPCR.FIZ=1: for which floating-point instructions inputs are not flushed to zero?
Arm Architecture Reference Manual for A-profile architecture (issue I.a) (emphasis added):
FIZ, bit [0]
When FEAT_AFP is implemented:
0b1 Denormalized single-precision and double-precision inputs to most floating-point
instructions flushed to…

pmor
- 5,392
- 4
- 17
- 36
0
votes
1 answer
Why comparing a small floating-point number with zero yields random result?
I am aware that floating-point numbers are tricky. But today I encountered a case that I cannot explain (and cannot reproduce using a standalone C++ code).
The code within a large project looks like this:
int i = 12;
// here goes several function…

bruin
- 979
- 1
- 10
- 30
-1
votes
1 answer
Denormal Numbers in IEEE std Floating point standard
What I think right is that in single floating point and normal case the smallest value would be
(in abs value)
1.0 × 2-126
But in denormal case (when exponent is 000...0) the smaller value can be represented like
2-23 × 2-127 = 2-150
only one…

Jin
- 3
- 3