Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #8355 > unrolled thread

DEC64=="Bee's knees"?

Started byluser droog <mijoryx@yahoo.com>
First post2018-02-12 19:12 -0800
Last post2018-02-13 05:13 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.programming


Contents

  DEC64=="Bee's knees"? luser droog <mijoryx@yahoo.com> - 2018-02-12 19:12 -0800
    Re: DEC64=="Bee's knees"? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-02-13 05:13 +0000

#8355 — DEC64=="Bee's knees"?

Fromluser droog <mijoryx@yahoo.com>
Date2018-02-12 19:12 -0800
SubjectDEC64=="Bee's knees"?
Message-ID<10fe9ae4-ddae-4aef-8fbb-fd7ef8618070@googlegroups.com>
I was watching some youtube videos about language design
and what the languages of the future should be like. And
one video strongly suggested that 'int' be dropped as a
basic type in new languages in favor of DEC64.

DEC64 is a sort of hybrid floating-point/scaled-integer
type. (https://en.wikipedia.org/wiki/DEC64) It has a 56 bit
mantissa, and an 8 bit decimal exponent. 

Since the exponent is decimal, the type can easily represent
'normal' decimal numbers like .2 without the bizarre effects
that binary fp's repeating expansion produces.

What problems might be encountered by (users of) a new 
language offering dec64 as its basic numeric type and 
eschewing 'int'?

[toc] | [next] | [standalone]


#8356

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2018-02-13 05:13 +0000
Message-ID<87bmgth3pe.fsf@bsb.me.uk>
In reply to#8355
luser droog <mijoryx@yahoo.com> writes:

> I was watching some youtube videos about language design
> and what the languages of the future should be like. And
> one video strongly suggested that 'int' be dropped as a
> basic type in new languages in favor of DEC64.
>
> DEC64 is a sort of hybrid floating-point/scaled-integer
> type. (https://en.wikipedia.org/wiki/DEC64) It has a 56 bit
> mantissa, and an 8 bit decimal exponent.

The wiki pages says "[i]ts aim is to sidestep the rounding errors common
to the widespread IEEE 754 format" but you can't really avoid rounding
errors.  You just get to choose which ones you have!

> Since the exponent is decimal, the type can easily represent
> 'normal' decimal numbers like .2 without the bizarre effects
> that binary fp's repeating expansion produces.

1/3 can not be represented, for example.  That might surprise some
people more than 0.2 not being representable in conventional binary FP.
It rather depends on the problem domain.

> What problems might be encountered by (users of) a new 
> language offering dec64 as its basic numeric type and 
> eschewing 'int'?

That depends on the problem domain too, but like JavaScript does, you'd
probably need to provide a set of integer-like operations (integer
division, mod, bit-wise operations) and so on because most programmers
would expect them.

Also worth noting is that there is already a relatively widely supported
IEEE decimal floating-point standard.  It would have to compete with
that.

-- 
Ben.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.programming


csiph-web