Note that this will also trim any multiples of n, so if n = 2 as in the example above it will also trim 4 zeros, 6 zeros, etc.
Your request sounds related to number formatting. Maybe PRINT USING or printf (from C standard library) would be worth a look as well.
Search found 1599 matches
- Mar 10, 2022 8:03
- Forum: General
- Topic: Feature Request
- Replies: 5
- Views: 658
- Mar 05, 2022 12:29
- Forum: General
- Topic: memcpy function location
- Replies: 23
- Views: 1863
Re: memcpy function location
The thing I wanted to point out is that linking to ucrtbase directly isn't supported and may cause your application to break in future . I'm aware that you can hardcode the "memcpy" (or any other) exported name in your application right now, but a future version of the DLL may only export ...
- Mar 05, 2022 10:34
- Forum: General
- Topic: memcpy function location
- Replies: 23
- Views: 1863
Re: memcpy function location
Address of memcpy in two locations. I don't really see what is this program is supposed to show us? One thing it definitely shows us is how to NOT use UCRT :P Linking ucrtbase directly is forbidden and might break your application, see https://mingwpy.github.io/ucrt.html for details (was referring ...
- Mar 04, 2022 17:34
- Forum: Community Discussion
- Topic: win 11 gfx win slightly dark
- Replies: 6
- Views: 968
Re: win 11 gfx win slightly dark
maybe something related to scaling? Could be verified by setting scaling to 100% in display settings and testing whether the issue still persists.
but just guessing ...
but just guessing ...
- Mar 03, 2022 7:30
- Forum: General
- Topic: memcpy function location
- Replies: 23
- Views: 1863
Re: memcpy function location
hm, I only tried a small example program so far. Could you try removing the # inclib "msvcrt" from crt.bi or replace it with # inclib "ucrt" ? is memcpy the only thing from the CRT you use explicitly in your code (not implicitly used by FB internally)? I'm not sure to which exten...
- Mar 02, 2022 21:40
- Forum: General
- Topic: memcpy function location
- Replies: 23
- Views: 1863
Re: memcpy function location
@coderJeff, do you think it would be possible to let FreeBASIC use a newer CRT, if just for a seperate build? The whole FreeBASIC team is doing a fantastic job and I couldn't possibly ask for more. But one can try. I'm not coderJeff :-) but out of interest I tried building a fbc version that links ...
- Feb 28, 2022 20:22
- Forum: Beginners
- Topic: Regular expression module(s)?
- Replies: 2
- Views: 675
Re: Regular expression module(s)?
I compiled PCRE about a year ago, feel free to use that: compiled and uploaded the latest version (of the v1 branch), which is currently 8.44 https://users.freebasic-portal.de/stw/files/prog/fb/libs/pcre-844-static.zip tried to use the same config as the older version; untested ; built with gcc 7.3....
- Feb 27, 2022 17:06
- Forum: General
- Topic: Branchless
- Replies: 39
- Views: 2471
Re: Branchless
A shorter code in assembler will always be faster! That contradicts to the examples shown in the linked CppCon talk above (btw really interesting talk): There are many articles and videos touching this, here's one: https://www.youtube.com/watch?v=g-WPhYREFjk So for example a shorter code could be s...
- Feb 27, 2022 14:43
- Forum: General
- Topic: memcpy function location
- Replies: 23
- Views: 1863
Re: memcpy function location
Out of interest I dug a bit deeper into this topic and learned something new and was reminded of things I didn't think about earlier. So first: it's true that the default FreeBasic build for Windows links to the old MSVCRT already shipped with Windows 95 (verified with Dependency Walker). This has t...
- Feb 27, 2022 1:10
- Forum: General
- Topic: memcpy function location
- Replies: 23
- Views: 1863
Re: memcpy function location
Okay thanks, I may try to code my own memcpy function then. As dodicat already pointed out, memcpy (and all the other basic methods provided by a CRT) are highly optimized and it's very unlikely that you end up in something equally fast or even faster. Thus it doesn't make sense to re-implement mem...
- Feb 26, 2022 11:48
- Forum: Windows
- Topic: Segmentation fault
- Replies: 10
- Views: 1429
Re: Segmentation fault
On a side note, Quicksort is only about 6 times faster than Bubblesort and the speed ratio doesn't improve with large numbers of data elements. I was surprised. With Quicksort having an average complexity of O(n*log(n)) and Bubblesort having an average complexity of O(n²) this can't really be true ...
- Feb 26, 2022 11:23
- Forum: General
- Topic: memcpy function location
- Replies: 23
- Views: 1863
Re: memcpy function location
I think fb_MemCopy is just an alias for the memcpy function (but not totally sure about that). memcpy itself is not implemented by FB, but a method of the CRT. You'd have to look into the toolchain's CRT sources. As far as the description of the Winlibs toolchain tells (which is the default one used...
- Feb 26, 2022 11:01
- Forum: General
- Topic: Branchless
- Replies: 39
- Views: 2471
Re: Branchless
Btw under the hood there must be always a branch :D If the comparison result is used in the calculation directly, as Provoni suggested, there isn't. If this was was related to IIF you're right of course. Provoni, if you really need that kind of optimization (which I doubt a bit) I'd go for an imple...
- Feb 25, 2022 0:51
- Forum: Community Discussion
- Topic: Observations.
- Replies: 138
- Views: 15556
Re: Observations.
[...] I have often compared PowerBASIC with FreeBASIC, both here and at PowerBASIC, without ever intending to promote either. I actually enjoy using both languages. You did not repeatedly answer with PowerBASIC code (and no FreeBASIC code) to programming question on this forums, just to bring up on...
- Feb 23, 2022 20:13
- Forum: Community Discussion
- Topic: Observations.
- Replies: 138
- Views: 15556
Re: Observations.
[...] The last member who called out on him was St_W, telling him that his answer 'wasn't all that helpful'. The warning level was raised to 'official'. [...] https://www.freebasic.net/forum/viewtopic.php?p=290047#p290047 As I unfortunately seem to be somehow involved here, some of my thoughts: Yes...