Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: How can I work with fractions (for example ½) in gnome-calculator?

  1. #1
    Join Date
    Apr 2023
    Beans
    10

    Talking How can I work with fractions (for example ½) in gnome-calculator?

    Hello everyone,

    I recently needed to work with fractions on my computer and had to use a website to do that, because I don't know how to work with fractions on gnome-calculator. Is there a way I can input fractions in gnome-calculator and perform mathematical operations with them?

    Thank you,
    Christopher

  2. #2
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: How can I work with fractions (for example ½) in gnome-calculator?

    You can always treat fractions as division for example in bc:

    Code:
    $ bc
    bc 1.07.1
    Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc.
    This is free software with ABSOLUTELY NO WARRANTY.
    For details type `warranty'. 
    scale=3
    2/5
    .400
    5/8
    .625
    2/5+5/8
    1.025
    quit
    $
    If you are not sure in which order bc is doing the calculations in a complex expression, think PEMDAS, and use parenthesis to make things evident.

    You can also use a spreadsheet program, for example LibreOffice Calc or Gnumeric.

    You can also treat fractions as division in gnome-calculator, just like I do above in bc.

    Or do you want to do algebra (symbolic operations) and/or get the result as a fraction too?
    Last edited by sudodus; April 26th, 2023 at 03:24 PM.

  3. #3
    Join Date
    Apr 2023
    Beans
    10

    Re: How can I work with fractions (for example ½) in gnome-calculator?

    I want to do algebra and get the result as a fraction (I don't want to treat fractions as divisions). Is that possible?

  4. #4
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: How can I work with fractions (for example ½) in gnome-calculator?

    See for example these links:

    Symbolic mathematics on Linux

    Best Free Linux Computer Algebra Systems

    or search the internet for 'symbolic math linux' (without quotes) and find more links.



    Edit: You made me interested, so I installed maxima and read this intro.

    Code:
    $ sudo apt install maxima
    ...
    $ maxima
    
    Maxima 5.45.1 https://maxima.sourceforge.io
    using Lisp GNU Common Lisp (GCL) GCL 2.6.12
    Distributed under the GNU Public License. See the file COPYING.
    Dedicated to the memory of William Schelter.
    The function bug_report() provides bug reporting information.
    (%i1) 2/5+5/8;
                                          41
    (%o1)                                 --
                                          40
    (%i2) %, numer;
    (%o2)                                1.025
    (%i3) quit();
    $
    Last edited by sudodus; April 26th, 2023 at 04:22 PM.

  5. #5
    Join Date
    Apr 2023
    Beans
    10

    Re: How can I work with fractions (for example ½) in gnome-calculator?

    I have just installed Cantor with the Maxima backend and it works perfectly! Thanks for your support, sudodus!

  6. #6
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: How can I work with fractions (for example ½) in gnome-calculator?

    You are welcome @chris0nlinux

    Please click on Thread Tools at the top of the page and mark this thread as SOLVED

  7. #7
    Join Date
    Aug 2013
    Beans
    4,941

    Re: How can I work with fractions (for example ½) in gnome-calculator?

    Quote Originally Posted by chris0nlinux View Post
    I have just installed Cantor with the Maxima backend and it works perfectly! Thanks for your support, sudodus!
    wxMaxima is a much better front end for Maxima then Cantor. Having said that I don't know why you need a calculator to work with fractions.

  8. #8
    Join Date
    Apr 2023
    Beans
    10

    Re: How can I work with fractions (for example ½) in gnome-calculator?

    This works well too!

  9. #9
    Join Date
    Jun 2011
    Location
    North Carolina
    Beans
    514
    Distro
    Ubuntu

    Re: How can I work with fractions (for example ½) in gnome-calculator?

    I'm probably missing something, but wouldn't one simply enter 0.5 for half? 2/3 would be 0.67 and so on.

    And 0.53 (given that is the actual measurement) is more precise than 1/2.
    Ubuntu 24.04 LTS | Toshiba Satellite C655 | i3 2.3Ghz | Intel HD Graphics 3000 | 8GB RAM | 65GB SSD
    Fedora 40 | Lenovo Edge 15 | i5 1.7Ghz | Intel HD Graphics 4400 | 6GB RAM | 1TB HDD

  10. #10
    Join Date
    Oct 2005
    Location
    Holland
    Beans
    938
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: How can I work with fractions (for example ½) in gnome-calculator?

    The point you are missing is this: in a computer 1/2 is not necessarily the same as 0.5. Floating point numbers almost never are exact.
    So when doing a calculation it is best to maintain precision up to until the final result. Pi must remain pi, e must remain e, 1/3 must remain 1/3 (and not 0.33333333 .
    When calculating 1/2 + 1/3 you should use the answer 5/6, and not 0.5 + 0.33333 = 0.833333

    So it pays to use a calculator or program that gives the answer 5/6, which only a few do.

    If you think the precision of your computer is sufficient, then there are situations in which that precision can easily vanish, partially or even totally. Ask your math teacher. Calculating a numerical derivative value is one of the very worst, and very common, examples. That is one of the reasons that you should learn in math.

    Topsiho

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •