ThreadTracer | Lightweight inline profiler that measures wall | Architecture library
kandi X-RAY | ThreadTracer Summary
kandi X-RAY | ThreadTracer Summary
Lightweight inline profiler that measures wall-time, cpu-time and premptive context switches for threads.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ThreadTracer
ThreadTracer Key Features
ThreadTracer Examples and Code Snippets
Community Discussions
Trending Discussions on ThreadTracer
QUESTION
I am normalizing a 3D vector, and the clang-9 generated code throws a SIGFPE on the sqrtf()
even though I do a test before calling it.
Note that I run with FP exceptions enabled.
...ANSWER
Answered 2020-Aug-14 at 00:57throws a domain error, even thoug I guard against negative numbers
But if (lensq > FLT_EPSILON)
is too late as earlier dx*dx + dy*dy + dz*dz
caused int
overflow. "and indeed overflow, causing lensq
to be negative" - which is undefined behavior UB.
Compiler can take advantage that sqrtf(lensq)
can always work because it can assume dx*dx + dy*dy + dz*dz >= 0
and so lensq >= 0.0f
.
Get rid of UB.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ThreadTracer
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page