hi,

On Sun, Apr 1, 2012 at 2:19 PM, Florian Anderiasch <m...@anderiasch.de> wrote:

> due to the widespread acceptance of binary number format (0b1010101) and
> the growing demand for backwards compatibility I've started to work on
> support for Roman Numerals (I, II, III, ...)

I am really really not sure we want that as part of the php scripts
like hex or binary. (Read: I do not want to have that :).

> As you might know, this format cannot be strictly parsed from left to
> right or right to left, as several number values need a look-ahead
> before being able to compute them (like IV), so my naive first
> implementation splits the string into tokens (like in 1990 = MCMXC =>
> M,CM,XC => 1000,900,90) then simplifying those 3 on their own, then
> adding the results, but I'm not sure this could kill performance if
> calculated inside zend_language_scanner.l.
>
> I'd appreciate any hints on how to tackle this serious concern.

Btw, it may be possible to parse roman number using ICU, using the
number parsing API. It is also possible to generate Roman numbers
using ICU as well, using numberFormat and some extra rules. The docs
have some examples.

Cheers,
-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to