Would =~= be what you're looking for?

Personally I like Rationals and am looking forward to being able to signify
that they should automatically become FatRats.

But if you're wedded to floating point then :

say 3602879701896397/36028797018963968 =~= 0.1 => True

say 3602879701896397/36028797018963968 =~= 0.1e0 => True

(As you're dealing in approximations).

On Wed, 7 Apr 2021 at 15:01, sisyphus <sisyphus...@gmail.com> wrote:

>
> On Wed, Apr 7, 2021 at 11:31 PM Vadim Belman <vr...@lflat.org> wrote:
>
>>
>> For exact match one can use eqv:
>>
>> say 1/10 eqv 0.1e0; # False
>> say 1/10*1e0 eqv 0.1e0; # True
>>
>
> I don't think this is quite what I'm after.
> I would want the following to be True, but it's False:
> C:\> raku -e "say 3602879701896397/36028797018963968 eqv 0.1e0"
> False
>
> And doing:
> C:\>raku -e "say 3602879701896397/36028797018963968*1e0 eqv 0.1e0"
> True
>
> C:\>raku -e "say 1/10*1e0 eqv 0.1e0"
> True
>
> seems to be essentially the same as doing:
> C:\_32>raku -e "say 3602879701896397/36028797018963968 == 0.1e0"
> True
>
> C:\_32>raku -e "say 1/10 == 0.1e0"
> True
>
> Cheers,
> Rob
>
>
>
>
>


-- 
Simon Proctor
Cognoscite aliquid novum cotidie

http://www.khanate.co.uk/

Reply via email to