Bobinas P4G
  • Login
  • Public

    • Public
    • Groups
    • Popular
    • People

Notices by Bernie (codewiz@mstdn.io), page 18

  1. Bernie (codewiz@mstdn.io)'s status on Sunday, 29-Oct-2023 04:00:39 UTC Bernie Bernie

    Is paru still a reasonable choice of #AUR helper for #archlinux ?

    Before I used yay and trizen, both of which became unmaintained. I just noticed that paru hasn't been updated in over 1 year...

    In conversation Sunday, 29-Oct-2023 04:00:39 UTC from mstdn.io permalink
  2. Bernie (codewiz@mstdn.io)'s status on Sunday, 29-Oct-2023 03:57:31 UTC Bernie Bernie
    in reply to
    • Zelphir Kaltstahl

    @zelphirkaltstahl It works with standard IEEE 754 floats, yes.

    The problem with doing (a - b) is that you might get 1000.0 or you might get 0.001. Depending on the magnitude of a and b, both might represent an expected rounding error in the least significant bits of a float.

    A codebase I'm working on had arbitrary epsilon constants: 1e-6 for floats and 5e-15 for doubles. Such absolute thresholds are only reasonable for values in a narrow range (for example 0.1..10.0).

    In conversation Sunday, 29-Oct-2023 03:57:31 UTC from mstdn.io permalink
  3. Bernie (codewiz@mstdn.io)'s status on Saturday, 28-Oct-2023 16:19:26 UTC Bernie Bernie
    in reply to
    • Maryam

    @Maryam It compares all 32 bits of the floats (there's no masking), but it allows the difference to be up to 4 ULPs = 2 least significant bits.

    In conversation Saturday, 28-Oct-2023 16:19:26 UTC from mstdn.io permalink
  4. Bernie (codewiz@mstdn.io)'s status on Saturday, 28-Oct-2023 10:53:23 UTC Bernie Bernie
    in reply to

    For more information, consult your local encyclopedia:
    https://en.wikipedia.org/wiki/Single-precision_floating-point_format

    #programming #c #cpp

    In conversation Saturday, 28-Oct-2023 10:53:23 UTC from mstdn.io permalink

    Attachments

    1. Single-precision floating-point format
      Single-precision floating-point format (sometimes called FP32 or float32) is a computer number format, usually occupying 32 bits in computer memory; it represents a wide dynamic range of numeric values by using a floating radix point. A floating-point variable can represent a wider range of numbers than a fixed-point variable of the same bit width at the cost of precision. A signed 32-bit integer variable has a maximum value of 231 − 1 = 2,147,483,647, whereas an IEEE 754 32-bit base-2 floating-point variable has a maximum value of (2 − 2−23) × 2127 ≈ 3.4028235 × 1038. All integers with 7 or fewer decimal digits, and any 2n for a whole number −149 ≤ n ≤ 127, can be converted exactly into an IEEE 754 single-precision floating-point value. In the IEEE 754-2008 standard, the 32-bit base-2 format is officially referred to as binary32; it was called single in IEEE 754-1985. IEEE 754 specifies additional floating-point types, such as 64-bit base-2 double precision and, more recently, base-10 representations. One of the first programming languages to provide...

    2. https://media.mstdn.io/mstdn-media/media_attachments/files/111/312/266/651/919/039/original/e846e452d67040b9.png
  5. Bernie (codewiz@mstdn.io)'s status on Saturday, 28-Oct-2023 10:44:43 UTC Bernie Bernie
    in reply to

    Of course this also works with double and long double.

    My production version of almost_equals() is templated using C++20 concepts and the nicer "auto" syntax:

    bool almost_equals(std::floating_point auto a, std::floating_point auto b) {
    auto abits = to_bits(a);
    auto bbits = to_bits(a);
    return distance(abits, bibits) < 4;
    }

    In conversation Saturday, 28-Oct-2023 10:44:43 UTC from mstdn.io permalink
  6. Bernie (codewiz@mstdn.io)'s status on Saturday, 28-Oct-2023 10:34:02 UTC Bernie Bernie

    @timlocke Oops! Somehow I managed to forget the beginning of your post by the time I started replying to it. I clearly need some rest 😞

    In conversation Saturday, 28-Oct-2023 10:34:02 UTC from mstdn.io permalink
  7. Bernie (codewiz@mstdn.io)'s status on Saturday, 28-Oct-2023 10:21:54 UTC Bernie Bernie
    in reply to

    The question on my mind was: does this give the correct distance even around the boundary of an exponent bump?

    And yes: mantissa and exponent are arranged in such a way that adding 1 to the binary form always yields the next float:

    >>> import struct
    >>> to_float = lambda i: unpack(">f", i.to_bytes(4))[0]
    >>> to_float(0x3FFFFFFF)
    1.9999998807907104
    >>> to_float(0x40000000)
    2.0
    >>> to_float(0x40000001)
    2.000000238418579

    #programming #c #cpp #python

    In conversation Saturday, 28-Oct-2023 10:21:54 UTC from mstdn.io permalink
  8. Bernie (codewiz@mstdn.io)'s status on Saturday, 28-Oct-2023 10:11:45 UTC Bernie Bernie

    I came across a clever method for approximate float comparison which exploits their binary representation:

    bool almost_equal(float a, float b) {
    uint32_t abits = to_bits(a);
    uint32_t bbits = to_bits(b);

    return abits - bbits < 4;
    }

    Where 4 is the tolerance in "units in the last place".

    to_bits() isn't a simple bit_cast. It also does some magic with the sign bit. But for now let's only consider positive floats...

    #programming #c #cpp

    In conversation Saturday, 28-Oct-2023 10:11:45 UTC from mstdn.io permalink
  9. Bernie (codewiz@mstdn.io)'s status on Friday, 27-Oct-2023 07:59:21 UTC Bernie Bernie
    in reply to
    • Christian Horn

    @globalc Good catch!

    These are my photos of the event:
    https://photos.app.goo.gl/fwFeWidp2yTuzYXW8

    In conversation Friday, 27-Oct-2023 07:59:21 UTC from bobinas.p4g.club permalink

    Attachments

    1. AmiWest 2023
      59 new items added to shared album
  10. Bernie (codewiz@mstdn.io)'s status on Thursday, 26-Oct-2023 19:48:06 UTC Bernie Bernie
    • ultrageranium
    • Gary

    @timlocke @witewulf @320x200 With today's wisdom, it's kind of horrifying to think the number of vulnerabilities we were exposing to dialup users 😂

    Were you also part of FidoNet? AmigaNet? Using Trapdoor?

    In conversation Thursday, 26-Oct-2023 19:48:06 UTC from mstdn.io permalink
  11. Bernie (codewiz@mstdn.io)'s status on Thursday, 26-Oct-2023 19:44:34 UTC Bernie Bernie
    in reply to

    Duncan: "How many robots did you destroy?"

    何体のロボットを破壊した?
    nan-tai no robotto o hakai shita?

    This time, instead of 何人 (nan-nin) = how many people, Duncan uses 何体 (nan-tai) = how many bodies.

    I would have expected 何台 (nan-dai, how many machines), but I guess dead robots are bodies too 🙂

    #anime #PLUTO #japanese

    In conversation Thursday, 26-Oct-2023 19:44:34 UTC from mstdn.io permalink

    Attachments


    1. https://media.mstdn.io/mstdn-media/media_attachments/files/111/303/004/760/114/547/original/6593e92cf4d1b8b8.jpg
  12. Bernie (codewiz@mstdn.io)'s status on Thursday, 26-Oct-2023 19:37:46 UTC Bernie Bernie
    in reply to

    The butler politely replies that "Robot Laws forbid me from harming humans":

    ロボット法により
    人間を傷つけることは
    禁じられています

    robotto hou ni yori
    ningen o kizutsukeru koto wa
    kinji rarete imasu

    #japanese #anime #PLUTO

    In conversation Thursday, 26-Oct-2023 19:37:46 UTC from mstdn.io permalink

    Attachments


    1. https://media.mstdn.io/mstdn-media/media_attachments/files/111/302/967/784/128/569/original/646fdec7513cb660.jpg
  13. Bernie (codewiz@mstdn.io)'s status on Thursday, 26-Oct-2023 19:19:19 UTC Bernie Bernie

    In this scene of #PLUTO, the blind musician Duncan asks his robot butler:

    何人殺した?
    nan-nin koroshita?
    How many people did you kill?

    #japanese #anime

    In conversation Thursday, 26-Oct-2023 19:19:19 UTC from mstdn.io permalink

    Attachments


    1. https://media.mstdn.io/mstdn-media/media_attachments/files/111/302/901/606/631/878/original/41a475b6fe704a99.jpg
  14. Bernie (codewiz@mstdn.io)'s status on Thursday, 26-Oct-2023 09:01:32 UTC Bernie Bernie
    in reply to
    • ultrageranium
    • Gary

    @witewulf @320x200 I *loved* hearing the handshake sound of users connecting to my modems, and most of the time I was able to guess the CONNECT string from the sound.

    In conversation Thursday, 26-Oct-2023 09:01:32 UTC from mstdn.io permalink
  15. Bernie (codewiz@mstdn.io)'s status on Thursday, 26-Oct-2023 08:55:15 UTC Bernie Bernie
    in reply to
    • ultrageranium
    • Gary

    @witewulf @320x200 More screenshot of my DLG Pro board:

    https://www.codewiz.org/wikiedit/Pictures/amiga/SystemShockBBS/Screenshots
    #amiga #bbs #fidonet #asciiart

    In conversation Thursday, 26-Oct-2023 08:55:15 UTC from mstdn.io permalink
  16. Bernie (codewiz@mstdn.io)'s status on Thursday, 26-Oct-2023 08:53:58 UTC Bernie Bernie
    in reply to
    • ultrageranium
    • Gary

    @witewulf @320x200 Here's the only Amiga ASCII art I ever made. It's the banner of my BBS running on an Amiga 4000.

    Unfortunately, the font I was using with Term at the time is (probably) Topaz 11, which lacks the "cohesive" look of the old Topaz 8.

    #amiga #retrocomputing #bbs #fidonet #asciiart

    In conversation Thursday, 26-Oct-2023 08:53:58 UTC from mstdn.io permalink

    Attachments


    1. https://media.mstdn.io/mstdn-media/media_attachments/files/111/300/448/808/842/641/original/601b71ab3e9e5743.png
  17. Bernie (codewiz@mstdn.io)'s status on Wednesday, 25-Oct-2023 12:12:44 UTC Bernie Bernie
    in reply to
    • Nick Montfort

    ^--- look at this, @nickmofo!

    In conversation Wednesday, 25-Oct-2023 12:12:44 UTC from mstdn.io permalink
  18. Bernie (codewiz@mstdn.io)'s status on Wednesday, 25-Oct-2023 11:51:35 UTC Bernie Bernie
    in reply to
    • ultrageranium
    • [realhackhistory@home]#

    @realhackhistory @320x200 Amazing!

    In conversation Wednesday, 25-Oct-2023 11:51:35 UTC from mstdn.io permalink
  19. Bernie (codewiz@mstdn.io)'s status on Tuesday, 24-Oct-2023 06:44:12 UTC Bernie Bernie

    Litterae Finis by Trauma (2012)
    https://solhsa.com/litterae/

    Perhaps not the most visually impressive demo with a title in Latin, but the soundtrack by !Cube is just fantastic.

    If you don't like ASCII art, you can still enjoy it with your eyes closed. And if you also don't like #synth sound... well, then perhaps the #demoscene isn't for you! 😜

    In conversation Tuesday, 24-Oct-2023 06:44:12 UTC from mstdn.io permalink

    Attachments


  20. Bernie (codewiz@mstdn.io)'s status on Monday, 23-Oct-2023 07:28:44 UTC Bernie Bernie

    @jherazob Here it says that the #manga is worth reading before watching the #anime:
    https://www.cbr.com/the-apothecary-diaries-manga-worth-reading-before-anime-arrives/

    In conversation Monday, 23-Oct-2023 07:28:44 UTC from mstdn.io permalink

    Attachments


  • After
  • Before

User actions

    Bernie

    Bernie

    🇮🇹 → 🇺🇸 → 🇯🇵 → 🇹🇭 → 🚀Nomadic Linux developer, currently in Los Angeles.#linux #rust #anime #spacex #cycling #travel #vegan #retrocomputing #amiga #fedi22𝑨𝑴𝑰𝑮𝑨 :amiga:

    Tags
    • (None)
    WebSub
    Pending
    ActivityPub
    Remote Profile

    Following 0

      Followers 1

      • Galip (Inactive)

      Groups 0

        Statistics

        User ID
        7840
        Member since
        27 Jan 2018
        Notices
        6555
        Daily average
        2

        Feeds

        • Atom
        • Help
        • About
        • FAQ
        • Privacy
        • Source
        • Version
        • Contact

        Bobinas P4G is a social network. It runs on GNU social, version 2.0.1-beta0, available under the GNU Affero General Public License.

        Creative Commons Attribution 3.0 All Bobinas P4G content and data are available under the Creative Commons Attribution 3.0 license.