[Interest] Is it a LGPLv3 infringement to copy paste qFuzzyCompare implementation
b.terrier at gmail.com
Fri Jul 22 10:10:55 CEST 2016
My personal experience is that it will depend on the countries in
which you develop
and distribute your software.
In France for instance software are protected by "author's rights" which implies
that to be protected a piece of code must have some kind of creativity and/or
originality. So my guess would be that according to French laws qFuzzyCompare
cannot be protected and thus can be copy-pasted without infringing
neither the law
nor the LGPL.
Note that this is only a guess as only judges can rule if a piece of
code is original
enough to be protected.
If you want to be sure your best move is to contact the FSF or a
lawyer specializing in copyright.
2016-07-22 5:00 GMT+02:00 Ch'Gans <chgans at gna.org>:
> Hi there,
> I've recently added a "bool FuzzyCompare(float f1, float f2)" function
> to a proprietary software I'm currently paid to work on (this is plain
> C++ project, it doesn't use the Qt framework at all).
> Being a more-than-happy Qt user in my spare time I decided that I
> would first checkout the qFuzzyCompare implementation since I consider
> Qt developers as top-of-the-notch C++ wizards (no kidding and no
> attempt to be nice with them).
> I have added a comment to "my" implementation referring to the
> implementation of "qFuzzyCompare" in Qt5 source code (along with ).
> The 2 implementations look alike indeed (apart from using std::fabsf,
> std::min, etc.. in place of qAbs, qMin, ...), since the fuzzy compare
> is a well-known algorithm.
> My reference to Qt5 was there to justify the use of the "magic
> constant" 100000.f.
> I was pointed out that there's a potential LGPLv3 license
> infringement, although I understand where the FUD is coming from, I
> think that it is OK to read LGPLv3 source code to get inspired as long
> as you don't blindly copy/paste code (In my case i checked out quite a
> few articles and forum threads before choosing the Qt way as the best
> way to do it for my application).
> So my question is actually very serious, in this particular case,
> would this be considered as a LGPLv3 infringement of Qt5 to add this
> to a piece of proprietary software:
> // Taken from Qt5 source code, see
> http://doc.qt.io/qt-5/qtglobal.html#qFuzzyCompare-1 and
> // https://code.woboq.org/qt5/qtbase/src/corelib/global/qglobal.h.html#_ZL13qFuzzyCompareff
> // And for the insomniacs:
> bool FuzzyCompare(float f1, float f2)
> return (::fabsf(f1 - f2) * 100000.0f <= std::min(::fabsf(f1),
> For comparison purpose, here is the Qt source code:
> Q_DECL_CONSTEXPR static inline bool qFuzzyCompare(float p1, float p2)
> return (qAbs(p1 - p2) * 100000.f <= qMin(qAbs(p1), qAbs(p2)));
> You can find many more implementations of this algorithm on
> stack-overflow and other forums.
> At the end, I proposed to change the comments to refer to wikipedia
> instead of Qt5 source code and saying that 100000.0f is the right
> value for epsilon.
> I know this is a drop in an ocean (we're talking 1 line of C++), but i
> think the question is indeed interesting. Thanks for shedding light on
> this particular issue.
>  https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
> Interest mailing list
> Interest at qt-project.org
More information about the Interest