avoid '-0' as result of '=ceil( x )' with x = ( -1 .. 0 )
just a test to learn the craftsmanship of issue-ing and git-ing ...
Gnumeric announces in 'http://www.gnumeric.org/numerical-issues.html': 'We also do our best to hide the value "-0" from users.'.
But '=ceil( -0.5 )' results in '-0'.
Plenty functions in gnumeric/plugins/fn-math/functions.c have a 'catch-0' upfront to avoid such? CEIL hasn't. Tried to implement.
Of course everything may be improved / corrected by experienced developers.
the patch i'll try to push is:
static GnmValue *
gnumeric_ceil (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
{
// edit b. - TO STAY - 2021-10-10: avoid '-0' results
return ( gnm_fake_ceil( value_get_as_float( argv[ 0 ] ) ) == -0 )
? 0 // change to '0'
: value_new_float (gnm_fake_ceil (value_get_as_float (argv[0])));
}