develooper Front page | perl.perl6.users | Postings from April 2021

Re: Comparing Int and Num

Thread Previous | Thread Next
From:
Ralph Mellor
Date:
April 16, 2021 00:22
Subject:
Re: Comparing Int and Num
Message ID:
CAPLR5Sdyma_iYqYyu4=mxM52ZyE2qMnnbfLV9LCwe+81rT7=EA@mail.gmail.com
On Wed, Apr 14, 2021 at 3:10 AM sisyphus <sisyphus359@gmail.com> wrote:
>
> Is this a bug that I ought to report ?

I'm not yet convinced the issues you showed are classifiable as bugs.

Part of my reasoning for my conservatism is per the guidance Larry
provided in the design docs. In particular, per design doc S02:

> num         native floating point

> Num         number (approximate Real, generally via floating point)

Your focus is, aiui, floating point numbers, and Raku handling them
as exact doubles, not approximate Reals. As such I think we should
switch our focus to `num` for a while, not `Num`, and to initializing
`num` variables from `int`s, not `Int`s:

my int $i = ...;
my num $n = $i;

Also, maybe search for 'float' and 'num ' in these documents and read
what Larry had to say:

* https://design.raku.org/S02.html

* https://design.raku.org/S03.html

Also, maybe check out roast. A search for 'float' suggests these two
as the ones that at first glance seem most worth looking at:

* https://github.com/Raku/roast/blob/master/S03-operators/basic-types.t

* https://github.com/Raku/roast/blob/master/S03-operators/overflow.t

----

I hope to get time to respond to your earlier posts this weekend.

--
ralph

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About