Newest at the top
2025-01-09 12:05:11 +0100 | <hellwolf> | in python, it is `div` |
2025-01-09 12:04:56 +0100 | <hellwolf> | one for div one for quot |
2025-01-09 12:04:50 +0100 | <hellwolf> | not a good start :) |
2025-01-09 12:04:47 +0100 | <hellwolf> | I already find two semantics for "//" in two different languages |
2025-01-09 12:03:50 +0100 | <__monty__> | The lack of operators encouraging the use of divMod and quotRem is actually kind of a feature. |
2025-01-09 12:00:45 +0100 | <enikar> | :) |
2025-01-09 11:59:57 +0100 | <hellwolf> | A cut and smart parrot is a parrot, after all. |
2025-01-09 11:59:24 +0100 | <enikar> | indeed ;) |
2025-01-09 11:58:39 +0100 | <hellwolf> | I should stop using gpt for serious stuff. |
2025-01-09 11:58:31 +0100 | <hellwolf> | No, Java does not have a "//" operator for integer division. It uses the single "/" operator for both integer and floating point division. The type of division it performs (integer or floating point) depends on the types of the operands. If both operands are integers, it will perform integer division. If either or both operands are floating points, it will perform floating point division. |
2025-01-09 11:58:31 +0100 | <hellwolf> | nix-shell$ echo "Does Java not have // integer division operator, with two slashes" | chatgpt |
2025-01-09 11:58:23 +0100 | <lambdabot> | <hint>:1:4: error: parse error on input ‘**’ |
2025-01-09 11:58:22 +0100 | <hellwolf> | > 2. **Integer or Floor Division**: Denoted by "//" in Python and Java 8 onwards, '%' in Swift or the `div` function in Pascal. This operator rounds the result down to the nearest whole number. For example, in Python, 5//2 will result in 2. |
2025-01-09 11:57:35 +0100 | <hellwolf> | ya... :D |
2025-01-09 11:57:23 +0100 | <__monty__> | Isn't that a line comment in Java? |
2025-01-09 11:57:02 +0100 | <__monty__> | Alternatively, if you don't want to define them for yourself, you could add conceals (or whatever your editor calls them) for `div` et al. if you think it reads better or whatever. |
2025-01-09 11:57:01 +0100 | <hellwolf> | am I being scammed by ChatGPT? |
2025-01-09 11:55:49 +0100 | <orangeFlu> | Java does not have // afaik |
2025-01-09 11:55:09 +0100 | byorgey | (~byorgey@user/byorgey) byorgey |
2025-01-09 11:55:02 +0100 | byorgey | (~byorgey@user/byorgey) (Ping timeout: 252 seconds) |
2025-01-09 11:54:14 +0100 | pie_ | (~pie_bnc@user/pie/x-2818909) __ |
2025-01-09 11:53:56 +0100 | pie_ | (~pie_bnc@user/pie/x-2818909) (Ping timeout: 252 seconds) |
2025-01-09 11:49:57 +0100 | mud | (~mud@user/kadoban) (Read error: Connection reset by peer) |
2025-01-09 11:49:35 +0100 | <hellwolf> | could be an option. |
2025-01-09 11:49:23 +0100 | <mari-estel> | maybe they do not need to become operators |
2025-01-09 11:49:16 +0100 | <hellwolf> | //- ? |
2025-01-09 11:49:05 +0100 | kadobanana | (~mud@user/kadoban) kadoban |
2025-01-09 11:48:58 +0100 | <hellwolf> | I know, but I dont' know what better variant to use. |
2025-01-09 11:48:58 +0100 | <hellwolf> | 01-09 12:48 <mari-estel> hm _ conventionally means "discard returned" |
2025-01-09 11:48:43 +0100 | <hellwolf> | incidentally, I didn't know that recent Python and Java uses "//" to mean integral divisions. |
2025-01-09 11:48:40 +0100 | <mari-estel> | hm _ conventionally means "discard returned" |
2025-01-09 11:48:10 +0100 | <lambdabot> | Data.Vector.Generic (//) :: Vector v a => v a -> [(Int, a)] -> v a |
2025-01-09 11:48:10 +0100 | <lambdabot> | Data.Vector (//) :: Vector a -> [(Int, a)] -> Vector a |
2025-01-09 11:48:10 +0100 | <lambdabot> | GHC.Arr (//) :: Ix i => Array i e -> [(i, e)] -> Array i e |
2025-01-09 11:48:05 +0100 | <hellwolf> | ones with "_" truncating towards negative infinity |
2025-01-09 11:48:03 +0100 | <mari-estel> | @hoogle // |
2025-01-09 11:47:42 +0100 | <lambdabot> | Protolude (%) :: Integral a => a -> a -> Ratio a |
2025-01-09 11:47:42 +0100 | <lambdabot> | GHC.Real (%) :: Integral a => a -> a -> Ratio a |
2025-01-09 11:47:42 +0100 | <lambdabot> | Data.Ratio (%) :: Integral a => a -> a -> Ratio a |
2025-01-09 11:47:41 +0100 | <mari-estel> | @hoogle % |
2025-01-09 11:47:13 +0100 | <mari-estel> | i guess it has. Finding the conv is a different matter |
2025-01-09 11:47:08 +0100 | <hellwolf> | say `//, //_, %, %_' where the variants without "_" matches the behaviour you would most likely encounter in other languages (truncating towards zero) |
2025-01-09 11:46:21 +0100 | <hellwolf> | ? |
2025-01-09 11:46:13 +0100 | <hellwolf> | may I start a new topic, has it ever been discussed about having operators for `quot, rem, div, mod` |
2025-01-09 11:45:02 +0100 | <hellwolf> | etc. |
2025-01-09 11:45:01 +0100 | <hellwolf> | Scrive |
2025-01-09 11:44:54 +0100 | <hellwolf> | Mercury |
2025-01-09 11:44:48 +0100 | <hellwolf> | maerwald: that's surprising to hear |
2025-01-09 11:44:38 +0100 | alexherbo2 | (~alexherbo@2a02-8440-e505-36d8-e9e7-2f9d-7370-79e4.rev.sfr.net) alexherbo2 |
2025-01-09 11:44:26 +0100 | <orangeFlu> | what other haskell companies are out there? |