lua-users home
lua-l archive

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


Lua list <lua@bazar2.conectiva.com.br> on Wednesday, August 23, 2006 at
21:05 +0000 wrote:
>It has become a tradition for
>scripting languages to 
[let]
> numbers come in
>different kinds, by using coercion. 
...
> Is it worth discussing how Lua could
>support more than one sort of number?

Would it make sense to have binary coded decimal numbers as the default
numeric type for Lua? (Ooooh, controversial!) It's obviously much, much
slower than onboard floating point but is still fast enough for many uses
and it has its advantages:
- arbitrary precision only limited by memory
- precise integers and floats with a single datatype
- identical implementation and results across platforms
- not affected by endian issues
- requires only the most basic integer capabilities on the CPU
- no confusing binary round-off problems with comparisons
- etc...

Of course, we would still want the existing option of using different
numeric types with Lua but just supply BCD as standard. And there is more
than one option for coding BCD, which would cause some controversy, I'm
sure.

&.


#####################################################################################
This e-mail message has been scanned for Viruses and Content and cleared 
by MailMarshal.
The Blackpool Sixth Form College.
#####################################################################################