Sign in Join

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

Mailing lists / fpc-devel / 2006-07

patch to make math.pp more D7 compatible

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Burkhard Carstens

Tha attached patch changes the statistic functions (sum, mean, stddev etc.) to expect "array of double" instead of "array of float". For most of the functions, I left the result values of type float as in D7, they are also type extended. Only for minvalue and maxvalue, I changed the result also to double, because it doesn't make sense to have higher precision here and D7 does the same.

This changes might be problematic on platforms where double is not supported (if any), but as there are other functions using double in math.pp, I didn't care about this.

Regards
Burkhard

Reply by email

Florian Klaempfl
to Burkhard Carstens
Burkhard Carstens wrote 10 lines
Tha attached patch changes the statistic functions (sum, mean, stddev etc.) to expect "array of double" instead of "array of float". For most of the functions, I left the result values of type float as in D7, they are also type extended. Only for minvalue and maxvalue, I changed the result also to double, because it doesn't make sense to have higher precision here and D7 does the same. This changes might be problematic on platforms where double is not supported (if any), but as there are other functions using double in math.pp, I didn't care about this.

This is probably ancient stuff so for new stuff we should care about it :) I'll try to modify your patch.

Reply by email

Florian Klaempfl
to Florian Klaempfl
Florian Klaempfl wrote 14 lines
Burkhard Carstens wrote: > Tha attached patch changes the statistic functions (sum, mean, stddev > etc.) to expect "array of double" instead of "array of float". > For most of the functions, I left the result values of type float as in > D7, they are also type extended. Only for minvalue and maxvalue, I > changed the result also to double, because it doesn't make sense to > have higher precision here and D7 does the same. > > This changes might be problematic on platforms where double is not > supported (if any), but as there are other functions using double in > math.pp, I didn't care about this. This is probably ancient stuff so for new stuff we should care about it :) I'll try to modify your patch.

After a second thought I applied it unmodified because architectures not supporting double will map it an appropriate type anyways.

Reply by email

Burkhard Carstens
to Florian Klaempfl
Florian Klaempfl wrote 21 lines
Florian Klaempfl wrote: > Burkhard Carstens wrote: >> Tha attached patch changes the statistic functions (sum, mean, >> stddev etc.) to expect "array of double" instead of "array of >> float". For most of the functions, I left the result values of >> type float as in D7, they are also type extended. Only for >> minvalue and maxvalue, I changed the result also to double, >> because it doesn't make sense to have higher precision here and D7 >> does the same. >> >> This changes might be problematic on platforms where double is not >> supported (if any), but as there are other functions using double >> in math.pp, I didn't care about this. > > This is probably ancient stuff so for new stuff we should care > about it > > :) I'll try to modify your patch. After a second thought I applied it unmodified because architectures not supporting double will map it an appropriate type anyways.

ok. Thanks!

Reply by email

Marco van de Voort
to Florian Klaempfl: After a second thought I applied it unmodified because architectures not supporting…
Show quoted text 7 lines
Florian Klaempfl wrote: > > This is probably ancient stuff so for new stuff we should care about it > :) I'll try to modify your patch. After a second thought I applied it unmodified because architectures not supporting double will map it an appropriate type anyways.

Hmm. This possible breaks numlib. I believe I changed that to use the "float" type also, since it already was switchable depending on real type.

Reply by email

Burkhard Carstens
to Marco van de Voort
Marco van de Voort wrote 13 lines
> Florian Klaempfl wrote: > > This is probably ancient stuff so for new stuff we should care > > about it > > > > :) I'll try to modify your patch. > > After a second thought I applied it unmodified because > architectures not supporting double will map it an appropriate type > anyways. Hmm. This possible breaks numlib. I believe I changed that to use the "float" type also, since it already was switchable depending on real type.

Float didn't change.
If I find some time tomorrow, I'll try to make a new patch to have the stats functions overloaded for array of {single,double,extended} and put the appropriate ifdefs around them.

Regards,
Burkhard

Reply by email