visopsys.org

Visopsys Forums
It is currently Tue Jan 16, 2018 10:46 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Calculator for Visopsys
PostPosted: Sun Sep 01, 2013 8:02 pm 
Offline

Joined: Sun Sep 01, 2013 7:58 pm
Posts: 29
Hello, I saw Visopsys was missing a calculator program and I coded one.

Quoting from readme.txt:
Quote:
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


Top
 Profile  
 
 Post subject: Re: Calculator for Visopsys
PostPosted: Mon Sep 02, 2013 10:46 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 7:20 pm
Posts: 460
Fantastic, thanks so much nextvolume (A.K.A. Giuseppe 8-) )

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


Top
 Profile  
 
 Post subject: Re: Calculator for Visopsys
PostPosted: Mon Sep 02, 2013 6:38 pm 
Offline

Joined: Thu Aug 15, 2013 4:23 pm
Posts: 22
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


Top
 Profile  
 
 Post subject: Re: Calculator for Visopsys
PostPosted: Mon Sep 02, 2013 9:12 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 7:20 pm
Posts: 460
Looks great, nice work, mate! :clap:

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


Top
 Profile  
 
 Post subject: Re: Calculator for Visopsys
PostPosted: Mon Sep 02, 2013 11:32 pm 
Offline

Joined: Sun Sep 01, 2013 7:58 pm
Posts: 29
It is OK, of course! :)

_________________
Visopsys@Unhaut - http://unhaut.fav.cc/visopsys


Top
 Profile  
 
 Post subject: Re: Calculator for Visopsys
PostPosted: Mon Sep 02, 2013 11:46 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 7:20 pm
Posts: 460
Great, done! :character-cookiemonster:

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


Top
 Profile  
 
 Post subject: Re: Calculator for Visopsys
PostPosted: Tue Sep 03, 2013 12:35 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 7:20 pm
Posts: 460
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:
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 485 times
Top
 Profile  
 
 Post subject: Re: Calculator for Visopsys
PostPosted: Tue Sep 03, 2013 5:01 pm 
Offline

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group