Updates:
Status: Fixed
Comment #7 on issue 165 by benoit.m...@gmail.com: Arithmetic problem with
float
http://code.google.com/p/gambas/issues/detail?id=165
In revision #4365:
- I done the float to string conversion a bit differently.
- I correctly detect the glibc mathematical functions
Here is real sample for you:
Dim sngA As Single = 4.1
Dim sngB As Single = 2.2
Print sngA - sngB
1.899
Jussi
On Fri, Dec 23, 2011 at 20:33, Jussi Lahtinen wrote:
> You can use the samples. BUT some of them are because of bug of Gambas,
> not the general problem with floating points!
>
You can use the samples. BUT some of them are because of bug of Gambas, not
the general problem with floating points!
Example, Log2(536870912) = 29 is true with double precision floating points
but not with Gambas.
Also 8388608.0 is 8388608.0 in double precision floating point, but in
Gambas *shows
Now you guys come up with samples of floating point rounding hehehehe
A couple months ago I was looking for such rounding demos for my tutorials
I am writing. Note that this is just a part of programming. Many real
numbers do not have a direct representation in base 2 (binary). So to
represent
Comment #6 on issue 165 by jussi.la...@gmail.com: Arithmetic problem with
float
http://code.google.com/p/gambas/issues/detail?id=165
That is kind of expected result,
since with doubles (float in Gambas) the actual value is (5.025 - 5):
0.0253552713678800500929355621337890625000
And
Comment #5 on issue 165 by santiago...@gmail.com: Arithmetic problem with
float
http://code.google.com/p/gambas/issues/detail?id=165
I have posted something similar in the mailing list:
Print CString(Frac(5.025))
returns 0.0254
when I expected to get 0.025...
Comment #4 on issue 165 by benoit.m...@gmail.com: Arithmetic problem with
float
http://code.google.com/p/gambas/issues/detail?id=165
?8388608.0
8388607,
So I think the problem is in the Float->String conversion (which does not
use the C library).
---
Comment #3 on issue 165 by jussi.la...@gmail.com: Arithmetic problem with
float
http://code.google.com/p/gambas/issues/detail?id=165
Or do I file another bug report?
Jussi
--
Write once. Port to many.
Get the SDK and
Comment #2 on issue 165 by jussi.la...@gmail.com: Arithmetic problem with
float
http://code.google.com/p/gambas/issues/detail?id=165
Not sure.
Dim ff As Float
ff = Log2(536870912)
Print ff
ff = CInt(Log2(536870912))
Print ff
Print Log2(536870912) <> CInt(Log2(536870912))
Result:
*29*
*29*
Updates:
Status: Accepted
Labels: -Version -Priority-Medium Version-TRUNK Priority-Low
Comment #1 on issue 165 by benoit.m...@gmail.com: Arithmetic problem with
float
http://code.google.com/p/gambas/issues/detail?id=165
I think the problem is in the float to string conversion. I
oes back to the beginning of time
> -Fernando
>
> -- Original Message ---
> From: gam...@googlecode.com
> To: gambas-user@lists.sourceforge.net
> Sent: Wed, 21 Dec 2011 19:12:21 +
> Subject: [Gambas-user] Issue 165 in gambas: Arithmetic problem with float
>
-- Original Message ---
From: gam...@googlecode.com
To: gambas-user@lists.sourceforge.net
Sent: Wed, 21 Dec 2011 19:12:21 +
Subject: [Gambas-user] Issue 165 in gambas: Arithmetic problem with float
> Status: New
> Owner:
> Labels: Version Type-Bug Priority-Medium OpSys
Status: New
Owner:
Labels: Version Type-Bug Priority-Medium OpSys-Any Dist-Any Arch-Any
Desktop-Any GUI-Any
New issue 165 by jussi.la...@gmail.com: Arithmetic problem with float
http://code.google.com/p/gambas/issues/detail?id=165
1) Describe the problem.
Dim ff As Float = 2 ^ 23
Print f
13 matches
Mail list logo