Page 1 of 1

Calculator for Visopsys

Posted: Sun Sep 01, 2013 8:02 pm
by nextvolume
Hello, I saw Visopsys was missing a calculator program and I coded one.

Quoting from readme.txt:
This is my implementation of a calculator for the Visopsys operating system.
Visopsys is free and open source and you can get it at http://visopsys.org

This program was tested on Visopsys 0.72. This archive also includes a precompiled binary that is ready to use.

The easiest way to compile this program is to put calc.c in the Visopsys source tree in src/programs and to add calc to the programs that should be compiled.

The usage of this calculator does not need to be explained, as it is obvious, some things need to be clarified, though: the button labelled "dec" actually changes the current numeric base, if you press it once the current numeric base will be hexadecimal and the button will now be labelled "hex" and if you press it twice the base will be octal and the button labelled "oct". Pressing it three times restarts the cycle with "dec" and so on...
Floating point behavior might look a bit strange to people not accustomed to binary floating point operation: in fact, afteg some floating number, you might see it gets turned into another number. This happens due to the structure of binary floating pointer numbers; you can't represent many decimal floating point numbers precisely with binary floating pointer numbers. The only workaround to this would be using a software decimal floating point library.

This program is licensed under a two-clauses BSD license.

-- Giuseppe Gatta <tails92@gmail.com>
September 1st, 2013
Click here to download the archive (source code + binary). Enjoy! :)

Re: Calculator for Visopsys

Posted: Mon Sep 02, 2013 10:46 am
by andymc
Fantastic, thanks so much nextvolume (A.K.A. Giuseppe 8-) )

I'll have a look at this today or tonight. :D

Re: Calculator for Visopsys

Posted: Mon Sep 02, 2013 6:38 pm
by oscar
Welcome to the forum nextvolume :dance:

It's fantastic to have a calculator program for Visopsys, in graphic mode and very complete. I was trying to port one that I have done for linux but I was having some problem to port it, and moreover mine is very simple as I'm still learning :geek: So thank you and see you around! :)

Oscar

Re: Calculator for Visopsys

Posted: Mon Sep 02, 2013 9:12 pm
by andymc
Looks great, nice work, mate! :clap:

Is it OK if I include it in the main distribution for the next release? :character-chef:

Re: Calculator for Visopsys

Posted: Mon Sep 02, 2013 11:32 pm
by nextvolume
It is OK, of course! :)

Re: Calculator for Visopsys

Posted: Mon Sep 02, 2013 11:46 pm
by andymc
Great, done! :character-cookiemonster:

I found this icon https://www.iconfinder.com/icons/87414/calculator_icon for the program (and modified it a bit).

Re: Calculator for Visopsys

Posted: Tue Sep 03, 2013 12:35 am
by andymc
Here is an archive of the files I changed in the source tree. If you want to get this right away, you can unpack this in the top-level source distribution directory.

These are the added/modified files:

CREDITS.txt
contrib/giuseppe-calc/src/programs/calc.c
contrib/giuseppe-calc/src/programs/readme.txt
dist/programs/helpfiles/help.txt
dist/programs/helpfiles/calc.txt
dist/system/install-files.full
dist/system/config/programs.conf
dist/system/icons/calcicon.ico
src/programs/Makefile
src/programs/help.c
src/programs/calc.c

There's also a diff/patch file that you can apply with the following command in the top-level source distribution directory:

Code: Select all

patch -p0 < 03-1902_calculator_program.patch
(but you'd still need to copy the binary icon file manually)

Re: Calculator for Visopsys

Posted: Tue Sep 03, 2013 5:01 pm
by nextvolume
Looks like we forgot to check whether Visopsys is running in graphics mode or not.
It's a two-liner, but needs to be fixed :)