https://bugs.freedesktop.org/show_bug.cgi?id=45951

Eike Rathke <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #12 from Eike Rathke <[email protected]> ---
And just how would you like a negative number to be represented in bases other
than powers of 2?

For powers of 2 and two's complement, an easy way is to use the modulo value of
the known length, e.g. for 4 bit it is modulo 16 (2^4), so
=BASE(MOD(number,16),2) for values from -8 ("1000") to 7 ("111").

If you want you can extend that system to other bases, e.g. for base 3 with
length of 2 digits (modulo 3^2=9) the range could be -4 ("12") to 4 ("11") and
=BASE(MOD(-1,9),3) would result in "22". But that just would be a convention.

Doing the same for base 10 (decimal system) would result in a ten's complement,
on the other hand there (if at all) the nine's complement is used instead.

For base 16 you probably do not want a sixteen's complement but still a two's
complement instead.

Just some examples why I think this general approach to BASE is not a good
idea.

So instead of extending BASE with undefined functionality, defining some "radix
complement" function sounds more appropriate to me. I'm closing this report
here.

@Valerio:
You mentioned you proposed the same at OASIS, before doing such it would be
good to think about the technical implications and use cases.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to