Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about software-quality

Read more about software-quality

python (12.9k questions)

javascript (9.2k questions)

reactjs (4.7k questions)

java (4.2k questions)

java (4.2k questions)

c# (3.5k questions)

c# (3.5k questions)

html (3.3k questions)

Questions - software-quality

In C++, can the sum of two squared float be negative?

I have a snippet of code that compute the sum of two squared floats: float a, b, c; // assign some random float to b and c a = b*b+c*c; Can a, the sum of the two squared floats, be negative? The orig...
test-img

Alessandro Jacopson

c++

floating-point

software-quality

Votes: 0

Answers: 1

Latest Answer

It's not possible under IEEE754, as there is no wrap-around behaviour defined for float or double. Let's assume that you are defining a to be negative if a < 0.0 is true. That conveniently allows u...
test-img

Bathsheba

Reason for using custom true false values in frameworks

I was reading the GLFW library and I noticed they use GLFW_TRUE(1) and GLFW_FALSE(0). Now I've already seen that in other frameworks as well,making their own custom true/false identifiers. Is there an...
test-img

laegirl

c

frameworks

glfw

software-design

software-quality

Votes: 0

Answers: 4

Latest Answer

I guess it is for backward compatibility reasons. The stdbool.h header was introduced in the C99 standard.
test-img

nza

Posts

Questions

Blogs

Jobs

The ultimate platform for coders and IT specialists

About

  • Company
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved