GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    Maltimore (maltimore@social.tchncs.de)'s status on Friday, 17-Nov-2023 18:09:01 JST Maltimore Maltimore

    This morning, out of nowhere, I decided enough is enough. Python existed for over 30 years, so the following issue just shouldn't exist anymore:

    >>> 0.1 + 0.2 == 0.3
    False

    So I after people tried to convince me of julia for many years because it supposedly handles numbers much better, I finally tried it.

    julia> 0.1 + 0.2 == 0.3
    false

    Okay then.

    #Python #Julia

    In conversation Friday, 17-Nov-2023 18:09:01 JST from social.tchncs.de permalink
    • Embed this notice
      Tom Ritchford (tomswirly@toot.community)'s status on Friday, 17-Nov-2023 18:09:00 JST Tom Ritchford Tom Ritchford
      in reply to

      @maltimore

      "just shouldn't exist anymore"?!

      But you can easily prove there is no way to prevent this problem in general, which is why all programming languages have this!

      I strongly recommend reading some books on numerical analysis. The second volume of Knuth's The Art of Computer Programming has a chapter called "Arithmetic" that is still one of the best sources.

      In conversation Friday, 17-Nov-2023 18:09:00 JST permalink
      clacke likes this.
    • Embed this notice
      Maltimore (maltimore@social.tchncs.de)'s status on Friday, 17-Nov-2023 18:09:03 JST Maltimore Maltimore
      in reply to
      • vascorsd

      @vascorsd
      learn julia, they said. it handles numbers better, they said.

      In conversation Friday, 17-Nov-2023 18:09:03 JST permalink

      Attachments


      1. https://f2.tchncs.de/media_attachments/files/111/424/974/657/205/342/original/31c080116feff116.png
      clacke likes this.
    • Embed this notice
      vascorsd (vascorsd@mastodon.social)'s status on Friday, 17-Nov-2023 18:09:05 JST vascorsd vascorsd
      in reply to

      @maltimore the stupidity of modern languages of continuing to insist in making numbers be weird instead of actually working as numbers is bonkers, ridiculous and annoys me to no end. Computers and languages should help people do stuff and numbers working properly should be a basic thing that should work. The day I create my language numbers will be numbers and not this.

      In conversation Friday, 17-Nov-2023 18:09:05 JST permalink
    • Embed this notice
      clacke (clacke@libranet.de)'s status on Friday, 17-Nov-2023 18:09:05 JST clacke clacke
      in reply to
      • A* Ulven :verified_blobcat:

      @AlgorithmWolf You are late to the party.

      @maltimore

      In conversation Friday, 17-Nov-2023 18:09:05 JST permalink
    • Embed this notice
      A* Ulven :verified_blobcat: (algorithmwolf@ioc.exchange)'s status on Friday, 17-Nov-2023 18:09:07 JST A* Ulven :verified_blobcat: A* Ulven :verified_blobcat:
      in reply to

      @maltimore inb4 your replies are something along the line of "nooo, that is normal because of IEEE something something, you are using the wrong data type, you are just stupid"

      Just wait lol.

      In conversation Friday, 17-Nov-2023 18:09:07 JST permalink
    • Embed this notice
      Jens N (aserraric@social.tchncs.de)'s status on Saturday, 18-Nov-2023 12:34:07 JST Jens N Jens N
      in reply to
      • vascorsd

      @vascorsd @maltimore
      The problem (particularly in dynamically typed languages like Python) is that any change to type inference would be a major breaking change.
      You could create YAL (Yet Another Language) that treats non-integer number literals as decimals instead of floating point, but then you would have other problems to contend with. The ability of a compiler/interpreter to mind-read is limited.

      In conversation Saturday, 18-Nov-2023 12:34:07 JST permalink
      clacke likes this.
    • Embed this notice
      Silmathoron ⁂ (silmathoron@floss.social)'s status on Saturday, 18-Nov-2023 12:34:09 JST Silmathoron ⁂ Silmathoron ⁂
      in reply to

      @maltimore I see: it's less false in Julia, hence the lowercase "false", instead of the capitalized "False" in Python. Definitely going in the right direction!

      In conversation Saturday, 18-Nov-2023 12:34:09 JST permalink
      clacke likes this.

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.