*From*: newbie nullzwei <newbie-02 gmx de>*To*: Morten Welinder <mortenw gnome org>, Gnumeric Forum <gnumeric-list gnome org>*Subject*: additional questions regarding implementation and test cases | was: Aw: Re: simple? c-coding / gnumeric coding style question ...*Date*: Wed, 8 Sep 2021 14:49:22 +0200

hello @Morten, hello @all,

thanks for your input, complex stuff, newbies like me would need a simple sample ... will try to find one,

in the meantime i found another - better? - solution with using 'rint' in the process of rounding, and now have (complex) calculations producing better results for e.g. '=0.1 + 0.2' or '=1234.12 - 1234' and still correct results for other values. :-)

(it is! working, it is! coded in gnumeric, it is! producing correct results as far as i could test (extensive tests still to perform), and it is! calculating in binary, no! 'string math' tricks or similar!)

and from that the next two questions:

- to use / implement this i'd need to**find every point in the code where two doubles are added or subtracted and replace it with my function?** that's **far** too much of work. are there any easier possibilities e.g. 'hooking' the point(s) where gnumeric or goffice call FP operators or underlying libraries? somehow raping the compiler? or any other meaningful path? the probem is that i don't need to replace a function in the code, but a basic / fundamental operator ... looks difficult!

- where has gnumeric implemented tests for functions and how to construct / implement a new one? where and how is testing called / performed after building?

my solution still has limitations, e.g. rounding 1.005 to two decimals is not yet solved, i'll continue to work on that after having an easy way to test changes.

and the third question for today:

- who has some more 'problematic cases' at hand? i know the classics '=0.1 + 0.2' and '=1234.12 - 1234', i have worked through and solved the errors reported for LO Calc in bugzilla (most of them are just 'not understood cancellation effects'), and only by chance found the nice new challenge of rounding 1.005 to two decimals.

to prove my solution i'll need to compare plenty of random calculations, i think i can make a sheet doing that,

i can produce more problem cases by myself, but this could be disturbed by 'operational blindness' with me and would hardly cover the problem in general,

thus to have some more cases from others would be helpful ...

(sorry, silly questions, i know, i am! new to coding, but as far as the idea works up to now it's worth investing some effort to get it finished ...)

thanks for your input, complex stuff, newbies like me would need a simple sample ... will try to find one,

in the meantime i found another - better? - solution with using 'rint' in the process of rounding, and now have (complex) calculations producing better results for e.g. '=0.1 + 0.2' or '=1234.12 - 1234' and still correct results for other values. :-)

(it is! working, it is! coded in gnumeric, it is! producing correct results as far as i could test (extensive tests still to perform), and it is! calculating in binary, no! 'string math' tricks or similar!)

and from that the next two questions:

- to use / implement this i'd need to

- where has gnumeric implemented tests for functions and how to construct / implement a new one? where and how is testing called / performed after building?

my solution still has limitations, e.g. rounding 1.005 to two decimals is not yet solved, i'll continue to work on that after having an easy way to test changes.

and the third question for today:

- who has some more 'problematic cases' at hand? i know the classics '=0.1 + 0.2' and '=1234.12 - 1234', i have worked through and solved the errors reported for LO Calc in bugzilla (most of them are just 'not understood cancellation effects'), and only by chance found the nice new challenge of rounding 1.005 to two decimals.

to prove my solution i'll need to compare plenty of random calculations, i think i can make a sheet doing that,

i can produce more problem cases by myself, but this could be disturbed by 'operational blindness' with me and would hardly cover the problem in general,

thus to have some more cases from others would be helpful ...

(sorry, silly questions, i know, i am! new to coding, but as far as the idea works up to now it's worth investing some effort to get it finished ...)

(may be - i hope - a great improvement for fp-math in general is in reach, and thus any help invested may pay back in manyfold)

(and sorry, bear with me, i know that i'm writing like a 'troll' in some respects ... :-( :-( :-( ... it's not my intention, it's just that i'm not used to such developments and too short in time to do much learning now ... sorry again)

best regards, and TIA! for any support,

b.

--

**Gesendet:** Mittwoch, 08. September 2021 um 01:12 Uhr

**Von:** "Morten Welinder" <mortenw gnome org>

**An:** "newbie nullzwei" <newbie-02 gmx de>

**Cc:** "Gnumeric Forum" <gnumeric-list gnome org>

**Betreff:** Re: simple? c-coding / gnumeric coding style question ...

(and sorry, bear with me, i know that i'm writing like a 'troll' in some respects ... :-( :-( :-( ... it's not my intention, it's just that i'm not used to such developments and too short in time to do much learning now ... sorry again)

best regards, and TIA! for any support,

b.

--

If you really wanted to do something like that, you would call

function_def_call_with_values or function_call_with_exprs.

function_def_call_with_values or function_call_with_exprs.

**Follow-Ups**:

**References**:**simple? c-coding / gnumeric coding style question ...***From:*newbie nullzwei

**Re: simple? c-coding / gnumeric coding style question ...***From:*Morten Welinder

[Date Prev][Date Next] [Thread Prev][Thread Next] [Thread Index] [Date Index] [Author Index]