[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: floor usage?
From:       Brad Hards <bradh () frogmouth ! net>
Date:       2007-09-19 20:13:23
Message-ID: 200709200613.28573.bradh () frogmouth ! net
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Saturday 15 September 2007 21:17, Thomas Zander wrote:
> I just noted in kspread-trunk that the docs seem to imply a floor of -12.5
> is '-12'.  Now, I'm nowhere near a mathematician, but IMO that should
> be '-13'. No?
I think so, but the agreement is by no means universal. The openformula spec 
says:

FLOOR

Summary: Round a number N down to the nearest multiple of the second 
parameter, significance.

Syntax: FLOOR(  Number N [ ; Number significance [ ; Number mode ] ] )

Returns: Number

Constraints: Both N and significance must be numeric and have the same sign.

Semantics: Rounds a number down to a multiple of the second number. If 
significance is omitted it is assumed to be -1 if N is negative and +1 if N 
is positive, making the function act like the normal mathematical floor 
function. If mode is given and not equal to zero, the amount of N is rounded 
toward zero to a multiple of significance and then the sign applied. 
Otherwise, it rounds toward negative infinity.  If any of the two parameters 
N or significance is zero, the result is zero.

Warning: Many application user interfaces have a FLOOR function with only two 
parameters, and somewhat different semantics than given here (e.g., they 
operate as if there was a non-zero mode value).  These FLOOR functions are 
inconsistent with the standard mathematical definition of FLOOR.  Such 
applications shall convert such formulas into a 3-parameter format when 
saving in OpenFormula format, so that the saved formulas work correctly.

Brad

[Attachment #5 (application/pgp-signature)]

_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic