1. Re: arithmetic, etc

On 31 May 2002, at 22:06, George Walters wrote:

> 
> the inability of binary computers to accurately represent  base 10 numbers
> has been known since the beginning of computers, however, languages (i.e.
> fortran, basic, cobol,and any language i've ever used) deals with it where
> an equal (=) for normal arithmetic is useful.
> I'm beginning to see why euphoria is so fast... it doesen't do a lot of
> things that need to be done in a language. 

Yes, i wonder if Rob won't look at the libs in contributions, and find some 
way to incorporate the most used functions into the standard distribution, 
even if as an optional include file. I will haveto use one of the "include file 
searchers" to get the includes for the irc client, scattered all over the 
harddrive, to package this thing. Thing is, these includes are used in almost 
everything.

> If the floating point accuracy of the
> machine is ~10^ -15 then 10^ -14 should be considered zero (fuzz factor
> usually
> called). So instead of having to say that 'a = 0' (or a = anyother number) you
> must say 'abs(a)< .00000000000001' which is pretty poor... the language should
> do that for me. So to compare any 2 numbers you must use
> 'abs(a-b)<.00000000000001' is an equality. 

Speaking of things that would be great to have in Eu, like the BCD math, 
which i am half-heartedly working at, has anyone duplicated this in Eu yet? 
It's in C.
http://www.faqs.org/rfcs/rfc1321.html

> Without this you can't do any
> programming with the equal sign (=). You can't use equal (=) with strings
> either, you must use 'match'....so '=' is not too useful.

I tend to use equal() all the time anyhow, because Eu isn't smart enough 
(yet?) to do 
if seq[x] = atom
without an error. If it's one byte long, de-typecast it and compare it already.
If
it's over a byte long, then it's not equal, it's that simple.

And speaking of needed basics in the language,,, Karl, have you looked at 
eval() yet? the only way i can see doing it is with a preprocessor, and 
separate application, which has advantages, but a host of big disadvantages, 
mostly of time, memory requirements, and the inability to share variables. 
The one big advantage i had in mind was the ability to run the separate 
"thread" on another computer, but most people would not use that.

Kat

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu