[fpc-devel] format function

2006-10-12 Thread Andrea Mauri
Dear all, this is my first mail to this mailing list, I'm not sure this is the correct one to post this topic. I noticed a strange behavior of the format function. I'm not sure it can be considered as a bug. If I use format('%.3f', [-0.0001]) the resulting string is -0.000 and not 0.000 Why?

Re: [fpc-devel] format function

2006-10-12 Thread Andrea Mauri
Michael Van Canneyt wrote: Because your number is negative... The original number is taken to decide whether it should put the - sign or not. What does delphi do ? Michael. ___ Delphi gives 0.000 as result. a.

[fpc-devel] Round function

2006-10-12 Thread Andrea Mauri
Using round function I implemented the RoundTo function as in Delphi: type TRoundToRange = -37..37; function RoundTo(const AValue: Double; const ADigit: TRoundToRange): Double; var LFactor: Double; begin LFactor := IntPower(10, ADigit); Result := Round(AValue / LFactor) * LFactor; end; In

Re: [fpc-devel] format function

2006-10-12 Thread Andrea Mauri
Jonas Maebe wrote: Not only that, but -0.000 is different from 0.000 (at least for the fpu) Jonas In a mathematical way of view I think that -0.000 has no meaning. If I round something and the resulting value is zero, well zero is zero. Not +0 or -0. a.

[fpc-devel] TBits problem

2013-11-01 Thread Andrea Mauri
tested it on Win32 using lazarus: Lazarus 1.0.13 r42910M FPC 2.6.2 i386-win32-win32/win64 Could you please let me know if you can reproduce it or if I am doing something wrong? Best regards, Andrea Mauri -- Dr. Andrea Mauri, PhD Milano Chemometrics and QSAR Research Group Department

[fpc-devel] TBits problem

2013-11-01 Thread Andrea Mauri
FPC 2.6.2 i386-win32-win32/win64 Could you please let me know if you can reproduce it or if I am doing something wrong? Best regards, Andrea Mauri ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc

[fpc-devel] Re: TBits problem

2013-11-05 Thread Andrea Mauri
any hint? should I have to open a bug report? Il 31/10/2013 16:23, Andrea Mauri ha scritto: Dear All, I am using TBits object but I found some errors using it. Before adding a bugreport to the bugtracker I would be sure that there is nothing that I am doing wrong. Below a small procedure

Re: [fpc-devel] Re: TBits problem

2013-11-06 Thread Andrea Mauri
If you send a minimal test-case and actual results you might have a better chance at getting a reply... Below a sample test project. I create a TBits (b1) and then I set 16 bits as 1. Then I create 2 TBits (b2 and b3) with size 164, I use .OrBits to OR b1 with b2 and b3. I expect that

Re: [fpc-devel] Re: TBits problem

2013-11-07 Thread Andrea Mauri
Il 06/11/2013 18:41, Tomas Hajny ha scritto: Yes, I think so (although I have no clue regarding compatibility with Delphi, etc.) - looking at the implementation of OrBits (and also XorBits), the calculation which bits should be used is different from AndBits (and probably wrong - it checks if

[fpc-devel] gdk_gl_context_share_new no visual found

2014-06-06 Thread Andrea Mauri
Dear all, I developed an application using LazOpenGLContext, one of the application user reported me that he got an error: gdk_gl_context_share_new no visual found. Could you help me trying to identify the problem? What may I ask to better understand the problem and how to solve it? Andrea

[fpc-devel] samevalue function issue

2015-09-30 Thread Andrea Mauri
as samevalue(a, 44). But I am not sure since I did only few tests. Could you please provide some explanations? Why the two different behaviours? How should I use samevalue? Let me know and best regards, Andrea Mauri ___ fpc-devel maillist - fpc-devel

Re: [fpc-devel] samevalue function issue

2015-09-30 Thread Andrea Mauri
thanks. Il 30/09/2015 13:18, Jonas Maebe ha scritto: PS: please don't cross-post to multiple lists. my fault. andrea ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] tbits.NotBits

2017-03-31 Thread Andrea Mauri
one more thing. there is a method like clearall to set all bits to 1? clearall is much more faster then a simple iteration along all bits Il 31/03/2017 14:07, Andrea Mauri ha scritto: I didn't understand how TBits.NotBits works. Consider the following code: b:= TBits.Create(NRECORDS

[fpc-devel] tbits.NotBits

2017-03-31 Thread Andrea Mauri
Am I missing something? Thank you. Andrea Mauri ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] tbits.NotBits

2017-04-13 Thread Andrea Mauri
any answer? I asked in the wrong place? where should I ask? Il 31/03/2017 14:10, Andrea Mauri ha scritto: one more thing. there is a method like clearall to set all bits to 1? clearall is much more faster then a simple iteration along all bits Il 31/03/2017 14:07, Andrea Mauri ha scritto: I

Re: [fpc-devel] tbits.NotBits

2017-04-13 Thread Andrea Mauri
AFAIK a.NotBits(b) means (a and not b): a b result 0 0 0 0 1 0 1 0 1 1 1 0 Mattias Thank you Mattias. It works as you described. Anyway, since ClearAll, AndBits, OrBits etc works iterating on FBits : ^TBitArray; they are much faster then the simple iteration along property property Bits[Bit:

Re: [fpc-devel] tbits.NotBits

2017-03-31 Thread Andrea Mauri
. Is it possible to introduce a SetState procedure? Thanks again, Andrea Mauri Il 31/03/2017 14:10, Andrea Mauri ha scritto: one more thing. there is a method like clearall to set all bits to 1? clearall is much more faster then a simple iteration along all bits Il 31/03/2017 14:07, Andrea Mauri ha scritto

Re: [fpc-devel] Stringlist customsort

2018-11-30 Thread Andrea Mauri
Dear all, if TStringList sort will be changed, please take into account the issue related to randomised pivot initialisation in TStringList sort and the consequences to Random sequence ( http://forum.lazarus-ide.org/index.php?topic=43257.0). Andrea Il giorno ven 30 nov 2018 alle ore 09:15

Re: [fpc-devel] TStreamReader (streamex unit) issue

2021-04-09 Thread Andrea Mauri via fpc-devel
Submitted as: 0038734 (https://bugs.freepascal.org/view.php?id=38734) On Fri, 9 Apr 2021 at 09:11, Michael Van Canneyt wrote: > > Hello, > > Can you please post this in the bugtracker ? > So it will not be forgotten. > > Michael. > > On Thu, 8 Apr 2021, Andre