This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html
Set by lizmat on 8 June 2022.
10:20 CIAvash joined 12:04 habere-et-disper joined
habere-et-disper I think of `/` as a Rat constructor, so was surprised to see `pi` equal to a rational : 12:08
m: say pi == 245850922 / 78256779
camelia True
lizmat m: dd pi.WHAT 12:09
camelia Num
lizmat pi is a Num, so you're within the precision of Num comparisons 12:10
habere-et-disper Is it being truncated when stringified ? 12:11
m: say 245850922 / 78256779
camelia 3.141592654
habere-et-disper m: say pi == 3.141592654
camelia False
lizmat m: dd (245850922 / 78256779).WHAT
camelia Rat
lizmat m: dd (245850922 / 78256779) 12:12
camelia <245850922/78256779>
lizmat m: dd (245850922 / 78256779).Num
camelia 3.141592653589793e0
lizmat m: say pi == (245850922 / 78256779).Num
camelia True
habere-et-disper Thanks ! (y) 12:13
And I suppose it is types again with: 12:14
m: say i == (-1).sqrt
camelia False
lizmat m: use v6.e.PREVIEW: say i == (-1).sqrt 12:18
camelia ===SORRY!=== Error while compiling <tmp>
Bogus statement
at <tmp>:1
------> use v6.e.PREVIEW:⏏ say i == (-1).sqrt
expecting any of:
colon pair
lizmat m: use v6.e.PREVIEW; say i == (-1).sqrt
camelia True
lizmat habere-et-disper: fixed in 6.e
habere-et-disper Bravo ! 12:22
12:42 habere-et-disper left 13:14 discord-raku-bot left, discord-raku-bot joined 13:30 CIAvash left
dano Can I "precompile" a Raku program with Rakudo to bytecode (or whatever)? 15:43
lizmat yes, you can: by installing it 15:49
basically, turn your code into a module with META6.json and install that with zef: it will pre-compile the code for you
librasteve m: say pi =~= 3.14159265358979 18:39
Raku eval True