07:43
dakkar joined
|
|||
lizmat looks for a bridge | 09:22 | ||
Hydrazer | noice | 12:35 | |
16:36
dakkar left
19:12
neither joined
|
|||
neither | hi, hi! I have a numeric variable how can I check if it's an integer? For example the result of a square root operation. I'm doing `Int($v) == $v`, is this prefferable in the language? I looked at the documentation and find `is-int` method but it says it's for Range objects | 19:15 | |
To make it not an XY problem I'm checking if a number is a square like 196 | 19:17 | ||
gfldex | m:say (1, 1/1, 1.1, 2)».Rat».&{ .denominator == 1 }; | 19:27 | |
m: say (1, 1/1, 1.1, 2)».Rat».&{ .denominator == 1 }; | |||
gfldex | neither: it depends if you want to check for some typed that type checks against Int or if you are looking for a test that does Numeric | 19:29 | |
if you start with a string, you can use a Regex ofc. | |||
19:31
discord-raku-bot left,
discord-raku-bot joined
|
|||
gfldex | m: say 'eval bot test'; | 19:32 | |
neither | gfldex I don't understand your first message but thanks for denominator and regex ideas. | 19:33 | |
gfldex | If you got a float that is really close to an integer, things might get hairy. | 19:37 | |
neither | oh yeah | 19:38 | |
m: say 4.0000000000000001e0 == 4 | |||
gfldex | The eval bot is running on the Discord side in this channel. | 19:39 | |
neither | (i thought this is evaluated in here sorry.) | ||
gfldex | I should be able to fix this tho. | ||
19:45
discord-raku-bot left
19:46
discord-raku-bot joined
|
|||
gfldex | m: say 'eval test from irc'; | 19:46 | |
20:53
neither left
|