Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2020-09

Comment in math unit is a bit ambiguous?

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bart

Hi,

In unit math.pp you can find this comment:

510
<https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/rtl/objpas/math.pp?view=markup#l510> {
returns random values with gaussian distribution } 511
<https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/rtl/objpas/math.pp?view=markup#l511> function
RandG(mean,stddev : float) : float;
512
<https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/rtl/objpas/math.pp?view=markup#l512> function
RandomRange(const aFrom, aTo: Integer): Integer;
513
<https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/rtl/objpas/math.pp?view=markup#l513> function
RandomRange(const aFrom, aTo: Int64): Int64;

The grouping of these functions together with the comment suggests (at least it did to me) that the comment above it applies to all 3 functions. This is obviously not the case for the RandomRange functions.

I would propose to insert a single empty line between RandG and the RandomRange function, so it is more clear that the comment is only about the RandG function.

Bart

Reply by email

Florian Klämpfl
to Bart
Bart wrote 25 lines
Hi, In unit math.pp you can find this comment: 510 <https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/rtl/objpas/math.pp?view=markup#l510> { returns random values with gaussian distribution } 511 <https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/rtl/objpas/math.pp?view=markup#l511> function RandG(mean,stddev : float) : float; 512 <https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/rtl/objpas/math.pp?view=markup#l512> function RandomRange(const aFrom, aTo: Integer): Integer; 513 <https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/rtl/objpas/math.pp?view=markup#l513> function RandomRange(const aFrom, aTo: Int64): Int64; The grouping of these functions together with the comment suggests (at least it did to me) that the comment above it applies to all 3 functions. This is obviously not the case for the RandomRange functions. I would propose to insert a single empty line between RandG and the RandomRange function, so it is more clear that the comment is only about the RandG function.

Thanks, fixed.

Reply by email