New Forum for BASIC-256 (Web Help)

by Jim ⌂ @, Russell, KY, Thursday, November 11, 2010, 03:38 (2927 days ago)

Hey everybody,
The separate forum on the documentation and the web site have become a bit cumbersome to keep up with. This forum will be a place where we can get together as a community. Let us know if there is anything that can be done to make this even a better project.

New Forum for BASIC-256

by Frank, Holland, Thursday, December 30, 2010, 11:36 (2878 days ago) @ Jim

Hello,

how do I work with floatingpoint numbers ?

Like a=2.34 and b= 3.26
When dividing, b/a no problem but sum only shows integers.
Does this basic have a square root function ?

greetings,

Frank

New Forum for BASIC-256

by UglyMike @, Brussels, Friday, December 31, 2010, 12:29 (2877 days ago) @ Frank

Hi Frank!

Sorry but here, using v0.9.6p, no problems with sum...
A simple
a=2.344563
b=3.2613445
d= a+b
print d
will print out "5.605907", just like you'd expect....
What version are you using? Can we see your code snippet?

I didn't find how to do a root directly, but a ^0.5 gives the same result
So,
print 25^0.5
will give 5

Regards and a happy newyear!
Michel

New Forum for BASIC-256

by Frank @, Sunday, January 02, 2011, 13:58 (2875 days ago) @ UglyMike

Hello Michel,

thanks for your quick response.

Unfortunately it still doesn't work.

Also when I copy your a,b and d example

It shows 5,

Do I need to make some setting as long integer or double ?

Or is it a shortcoming of this version ?

I use Ubuntu 10.10 with version 0.9.6.48 (2010-11-03)

Your solution with ^0.5 works fine.

thanks,

Frank

New Forum for BASIC-256

by Frank @, Sunday, January 02, 2011, 14:04 (2875 days ago) @ Frank

Sorry just mailed that 25^0.5 works fine ,I meant the solution to the SQR.

But when I type it in this basic it gives the answer 1,

And 25 ^ 0 is 1 so also here the part behind the comma is wrong

New Forum for BASIC-256

by Jim ⌂ @, Russell, KY, Friday, January 07, 2011, 17:54 (2870 days ago) @ Frank

Frank,

I believe the problem has to do with the internationalisation stuff within c++. Here on my "en" environment (Ubuntu 10.10 and BASIC256 0.9.6.58) I run the following program

a=2.34
b= 3.26
print b/a
print b+a

and get

1.393162
5.6

as expected.

There have been no changes to the number handling since the version you are using. I am going to try to look into how to replicate your issues,

Jim Reneau

RSS Feed of thread
powered by my little forum