No Bug.
Floats have only 24 significant bits, which means you can store integer numbers just until ~ 16 mio.
Your integer number needs more than 26 bits, so the last binary digits are lost during your calculation and the number (even the integer part) becomes inaccurate.
You can use Double, they ...
Search found 37 matches
- Mon Jul 07, 2025 10:19 am
- Forum: Coding Questions
- Topic: [PB 6.21] Wrong precision on the integer part of floats
- Replies: 2
- Views: 327
- Mon Jul 07, 2025 12:47 am
- Forum: Coding Questions
- Topic: [PB 6.21] Wrong precision on the integer part of floats
- Replies: 2
- Views: 327
[PB 6.21] Wrong precision on the integer part of floats
I do understand that the decimal part of floats can be iffy but the integer part failing like this looks way too iffy to me.
Define measure.f = 25.0
Define value.q = 60
Define result.f = 73713600.0
result + (measure * value)
Debug(result)
; Prints 73715104.0 (incorrect)
Define measureb ...
Define measure.f = 25.0
Define value.q = 60
Define result.f = 73713600.0
result + (measure * value)
Debug(result)
; Prints 73715104.0 (incorrect)
Define measureb ...
- Tue Jun 17, 2025 3:38 am
- Forum: Bugs - Linux
- Topic: [PB 6.21] Regresion in console output behaviour
- Replies: 2
- Views: 687
[PB 6.21] Regresion in console output behaviour
There has been some kind of regresion/bug in how the output to the console is handled in PB6.21
The following code in PB6.20 allows you (using the arrow keys) to move the console's cursor inside the console window without filling it with garbage:
EnableExplicit
#CONSOLE_CODE_CURSOR_UP = Chr(27 ...
The following code in PB6.20 allows you (using the arrow keys) to move the console's cursor inside the console window without filling it with garbage:
EnableExplicit
#CONSOLE_CODE_CURSOR_UP = Chr(27 ...
- Mon Jun 09, 2025 10:04 pm
- Forum: Announcement
- Topic: PureBasic 6.21 is out !
- Replies: 169
- Views: 35769
Re: PureBasic 6.21 is out !
Many Thanks Fred,
Appreciate the bug fixing on Linux a lot.
Appreciate the bug fixing on Linux a lot.
- Fri Apr 11, 2025 1:42 pm
- Forum: Bugs - IDE
- Topic: not built-in debugger and no console
- Replies: 16
- Views: 3461
Re: not built-in debugger and no console
You can check this file to see all the supported terminals, may be there is a new one on your distro: https://github.com/fantaisie-software/purebasic/blob/devel/PureBasicIDE/LinuxMisc.pb
If I can make a suggestion having the IDE look for an environment variable to determine the terminal would ...
- Fri Mar 14, 2025 3:08 pm
- Forum: Linux
- Topic: DisableGadget not worked
- Replies: 10
- Views: 1616
Re: DisableGadget not worked
Works fine on Arch Linux PB 6.20
- Tue Dec 24, 2024 11:09 am
- Forum: Linux
- Topic: Possible memory leak in PB 6.12?
- Replies: 5
- Views: 3883
Re: Possible memory leak in PB 6.12?
Thanks for the suggestion, this is useful too.DarkDragon wrote: Thu Dec 19, 2024 4:58 pm Also keep in mind that valgrind also shows things as definitely lost which are intentionally not freed because the end of the process frees them anyway. Usually you'd generate a suppression file for that.
- Thu Dec 19, 2024 4:11 pm
- Forum: Linux
- Topic: Possible memory leak in PB 6.12?
- Replies: 5
- Views: 3883
Re: Possible memory leak in PB 6.12?
Hi Fred,
Good news, can't seem to trigger it in a loop.
After doing some more testing I've narrowed it down to this:
EnableExplicit
Structure uds_leak
test.a
List lst_list.s()
EndStructure
Define test.uds_leak
Basically the "leak" only shows up when using types a, b, c, w & l in a ...
Good news, can't seem to trigger it in a loop.
After doing some more testing I've narrowed it down to this:
EnableExplicit
Structure uds_leak
test.a
List lst_list.s()
EndStructure
Define test.uds_leak
Basically the "leak" only shows up when using types a, b, c, w & l in a ...
- Wed Dec 18, 2024 12:29 am
- Forum: Linux
- Topic: Possible memory leak in PB 6.12?
- Replies: 5
- Views: 3883
Re: Possible memory leak in PB 6.12?
Hi Fred,
Can you observe the leak in a loop ? Some resources are not released at end because of the OS tracking feature which auto cleanup everything. It's especially the case when using strings as tracking them will be inefficient and memory consuming.
I will try to see if I can reproduce it in ...
Can you observe the leak in a loop ? Some resources are not released at end because of the OS tracking feature which auto cleanup everything. It's especially the case when using strings as tracking them will be inefficient and memory consuming.
I will try to see if I can reproduce it in ...
- Tue Dec 17, 2024 1:05 pm
- Forum: Linux
- Topic: Possible memory leak in PB 6.12?
- Replies: 5
- Views: 3883
Possible memory leak in PB 6.12?
I think I've found a memory leak on PB 6.12, I've tested it with two computers and can reproduce the issue on both.
One computer is running Debian 11 (Linux 6.11.5) and the other is running an Arch machine up-to-date (Linux 6.12.4)
This is the offending code that can be used to reproduce it ...
One computer is running Debian 11 (Linux 6.11.5) and the other is running an Arch machine up-to-date (Linux 6.12.4)
This is the offending code that can be used to reproduce it ...
- Sun Jun 04, 2023 11:24 am
- Forum: Feature Requests and Wishlists
- Topic: Ability to specify terminal emulator in Linux
- Replies: 0
- Views: 660
Ability to specify terminal emulator in Linux
In Linux when creating and running console applications from the IDE the current Purebasic (v6.0.2) behaviour seems to be hard-coded to try to run Gnome-Terminal and if that is not available then run xterm as last resort.
In my case I have two DEs installed in my computer, Gnome-Desktop and XFCE ...
In my case I have two DEs installed in my computer, Gnome-Desktop and XFCE ...
- Sun Jun 04, 2023 11:06 am
- Forum: Feature Requests and Wishlists
- Topic: IDE: Pray stop the jumpy behaviour of the Search function
- Replies: 6
- Views: 2069
Re: IDE: Pray stop the jumpy behaviour of the Search function
+1 I'm an arthritic sufferer too.
- Sun Jun 04, 2023 10:41 am
- Forum: Linux
- Topic: Change Default Terminal
- Replies: 1
- Views: 1239
Re: Change Default Terminal
I have he opposite problem.
In my set-up I have both XFCE and Gnome Desktop installed, I use XFCE and need Gnome for testing.
In my case Purebasic defaults to Gnome-Terminal and in Arch Gnome-Terminal doesn't render text from Purebasic when running a terminal application from the IDE so I need to ...
In my set-up I have both XFCE and Gnome Desktop installed, I use XFCE and need Gnome for testing.
In my case Purebasic defaults to Gnome-Terminal and in Arch Gnome-Terminal doesn't render text from Purebasic when running a terminal application from the IDE so I need to ...
- Fri Oct 21, 2022 12:26 am
- Forum: Coding Questions
- Topic: Odd behaviour when using interface and strings
- Replies: 2
- Views: 462
Re: Odd behaviour when using interface and strings
Thank you so much!!!!

I knew it was my fault somehow!
- Thu Oct 20, 2022 11:13 pm
- Forum: Coding Questions
- Topic: Odd behaviour when using interface and strings
- Replies: 2
- Views: 462
Odd behaviour when using interface and strings
Hi all,
I'm not sure if what I am doing is correct or if I have found a bug, I would like for someone else to please test this code.
This example program creates an interface and a structure and then instantiates an "object" using a virtual table.
The object is very simple and all it does is set ...
I'm not sure if what I am doing is correct or if I have found a bug, I would like for someone else to please test this code.
This example program creates an interface and a structure and then instantiates an "object" using a virtual table.
The object is very simple and all it does is set ...