• thesmokingman@programming.dev
    link
    fedilink
    English
    arrow-up
    61
    arrow-down
    1
    ·
    7 months ago

    Here is what I get when I complete the search.

    And here’s what I get when I intentionally change the units. Notice the color difference?

    • sgh@lemmy.ml
      link
      fedilink
      English
      arrow-up
      13
      arrow-down
      5
      ·
      7 months ago

      I don’t think that’s the issue, OP also changed from 1 to 2, so I believe they basically want to know the result of 2 * 1024 * 1024, but the issue is that the result is written in scientific notation.

      • thesmokingman@programming.dev
        link
        fedilink
        English
        arrow-up
        17
        ·
        7 months ago

        When you search “megabytes to bytes” the units are correct and the number is one. If you edit the form, the number might not be one and the units might not be correct. Changing units highlights the unit input.

        OP’s ostensible point posting on this community is that searching “megabytes to bytes” gave “mebibytes to bytes” in the calculator but OP’s image shows OP has changed the calculator.

        • sgh@lemmy.ml
          link
          fedilink
          English
          arrow-up
          8
          arrow-down
          7
          ·
          edit-2
          7 months ago

          I don’t see any reply from OP so I’m growing confident that what you’re talking about is not OP’s point.

          Often times when coding you may want to quickly write down 2MB but you may need to type it in bytes, so either you calculate 2 * 1024 * 1024 while coding, or you remember the number 2097152.

          Now, since 2097152 is not such a common number that one would remember, you may quickly turn to the globally acclaimed oracle search engine to get such an answer, but all you get is a number in scientific notation, approximated, without an option to read it in standard decimal base. So you have to open the calculator and ask the same question again to get the answer you need.

          If it helps, try to ignore what’s in the search bar and tell me if it makes more sense.

          Edit: Additionally, if you were to NOT use the scientific notation, the length of the result would be shorter:

          2,097e+6 (8 characters) vs 2097152 (7 characters)

          • jas0n@lemmy.worldOP
            link
            fedilink
            English
            arrow-up
            8
            ·
            edit-2
            7 months ago

            Yeah. This was the problem. i just wanted to copy and paste it quickly but they rounded it off. It’s a useless conversion. And I switched it to mebibytes as well since that’s what everyone really means when they say megabytes unless you’re making selling storage devices. =]

            Indeed, I should have just used my calculator program.

          • thesmokingman@programming.dev
            link
            fedilink
            English
            arrow-up
            7
            arrow-down
            3
            ·
            7 months ago

            If I ignore what’s in the search bar, I remember that the prefix “mebi” means 2^20 and use a calculator. Your point doesn’t make sense because you’re asking us to get mad at a tool intended to convert scientific units for using the bog standard scientific notation. Byte math uses powers of 2 ergo we should use a calculator that isn’t explicitly set up for rounding.

            • sgh@lemmy.ml
              link
              fedilink
              English
              arrow-up
              3
              arrow-down
              6
              ·
              7 months ago

              Are you telling me that whenever you work with Digital Storage units you should never use scientific notation?

              • thesmokingman@programming.dev
                link
                fedilink
                English
                arrow-up
                6
                arrow-down
                3
                ·
                7 months ago

                You literally spent an entire comment explaining why you should not use scientific notation and now you’re asking why I might prefer precision in byte arithmetic?

                Good luck with that.

                • sgh@lemmy.ml
                  link
                  fedilink
                  English
                  arrow-up
                  3
                  arrow-down
                  6
                  ·
                  edit-2
                  7 months ago

                  Nope, au contraire, I agree, I’m just pointing out that you said that digital storage conversion should happen in non-scientific notation, so you should now agree with OP in that Google is choosing the wrong output format for a, quote from the screenshot, “Digital Storage” conversion.

                  And yes, I’m writing multiple comments trying to explain this through narrative, without having to point out what in your reasoning sounds stupid.

                  I.E. Now don’t you tell me that Google is incapable of figuring out which output format it should use for such a calculation…

                  Since I apparently need to explain this like you’re 5, please read my last comment like the following:

                  “Are you now agreeing with me/OP that whenever you work with Digital Storage units you should never use scientific notation?”

      • Carighan Maconar@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        arrow-down
        13
        ·
        7 months ago

        the issue is that the result is written in scientific notation

        Which honestly is never an issue, only people having forgotten how to fluently read it. 😛

        • sgh@lemmy.ml
          link
          fedilink
          English
          arrow-up
          7
          ·
          edit-2
          7 months ago

          It is an issue for two reasons:

          1. It’s an approximation, which might be completely useless to you when coding (ie. “Read a 2MiB chunk from a file” is different from “Read a 2097000 byte chunk”)
          2. It’s written down in a longer form than it would be if it was just written down in decimal base, which makes it completely useless to use such a notation in this case.

          Edit: seems like lemmy.ml is shitting themselves atm, excuse the multiple deleted comments

  • gerryflap@feddit.nl
    link
    fedilink
    English
    arrow-up
    15
    arrow-down
    3
    ·
    7 months ago

    What’s wrong? I find this a reasonable result. Most people looking for megabyte to bytes are actually looking for mebibytes, since the mega- prefix is literally just times a million but a lot of programs actually list mebibytes as “megabytes”.

  • DominusOfMegadeus@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    7
    ·
    7 months ago

    GPT gave me this yesterday:

    To convert 500 KiB/s to a more common unit like megabits per second (Mbps):

    1. Understand the conversion factors:

      • 1 KiB (Kibibyte) = 1024 bytes
      • 1 byte = 8 bits
    2. Calculate the speed in bits per second:

      • 500 KiB/s = 500 * 1024 bytes/s = 512000 bytes/s
      • 512000 bytes/s * 8 bits/byte = 4096000 bits/s
    3. Convert bits per second to megabits per second:

      • 1 Mbps = 1,000,000 bits/s (for simplicity, although technically 1 Mbps = 1,048,576 bits/s, the simpler metric is usually used for network speeds)
      • 4096000 bits/s / 1,000,000 = 4.096 Mbps

    So, 500 KiB/s is approximately 4.1 Mbps.

    I was like, I just wanted the answer!

    • Hackworth@lemmy.world
      link
      fedilink
      English
      arrow-up
      7
      ·
      7 months ago

      That’s for its own benefit. It has to talk through it (or alternatively code through it) to work out the answer. S’just showing its work.