Calculator for Visopsys

General discussion about Visopsys. We'll create more specific forums if the number of posts justifies that.
Post Reply
nextvolume
Posts: 30
Joined: Sun Sep 01, 2013 7:58 pm

Calculator for Visopsys

Post 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! :)
Visopsys@Unhaut - http://unhaut.fav.cc/visopsys
User avatar
andymc
Posts: 561
Joined: Tue Nov 16, 2010 7:20 pm

Re: Calculator for Visopsys

Post by andymc »

Fantastic, thanks so much nextvolume (A.K.A. Giuseppe 8-) )

I'll have a look at this today or tonight. :D
oscar
Posts: 22
Joined: Thu Aug 15, 2013 4:23 pm

Re: Calculator for Visopsys

Post 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
User avatar
andymc
Posts: 561
Joined: Tue Nov 16, 2010 7:20 pm

Re: Calculator for Visopsys

Post 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:
nextvolume
Posts: 30
Joined: Sun Sep 01, 2013 7:58 pm

Re: Calculator for Visopsys

Post by nextvolume »

It is OK, of course! :)
Visopsys@Unhaut - http://unhaut.fav.cc/visopsys
User avatar
andymc
Posts: 561
Joined: Tue Nov 16, 2010 7:20 pm

Re: Calculator for Visopsys

Post 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).
User avatar
andymc
Posts: 561
Joined: Tue Nov 16, 2010 7:20 pm

Re: Calculator for Visopsys

Post 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)
Attachments
calc.tar.gz
(21.82 KiB) Downloaded 769 times
nextvolume
Posts: 30
Joined: Sun Sep 01, 2013 7:58 pm

Re: Calculator for Visopsys

Post 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 :)
Visopsys@Unhaut - http://unhaut.fav.cc/visopsys
Post Reply